From f2b61bd17c233764d4a36bae02f998f7dd3a5427 Mon Sep 17 00:00:00 2001 From: jfrery Date: Tue, 23 Apr 2024 15:14:45 +0200 Subject: [PATCH] chore: fix test rounding_threshold_bits --- src/concrete/ml/common/utils.py | 3 ++- tests/torch/test_compile_torch.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/concrete/ml/common/utils.py b/src/concrete/ml/common/utils.py index f769531b7..61d193911 100644 --- a/src/concrete/ml/common/utils.py +++ b/src/concrete/ml/common/utils.py @@ -636,7 +636,8 @@ def process_rounding_threshold_bits(rounding_threshold_bits): valid_keys = {"n_bits", "method"} if not valid_keys.issuperset(rounding_threshold_bits.keys()): raise KeyError( - f"Invalid keys in rounding_threshold_bits. Allowed keys are {valid_keys}." + f"Invalid keys in rounding_threshold_bits. " + f"Allowed keys are {sorted(valid_keys)}." ) n_bits_rounding = rounding_threshold_bits.get("n_bits") if n_bits_rounding == "auto": diff --git a/tests/torch/test_compile_torch.py b/tests/torch/test_compile_torch.py index b80c65def..1f5629331 100644 --- a/tests/torch/test_compile_torch.py +++ b/tests/torch/test_compile_torch.py @@ -1423,7 +1423,7 @@ def forward(self, x): ( {"invalid_key": 4}, KeyError, - "Invalid keys in rounding_threshold_bits. Allowed keys are {'n_bits', 'method'}.", + "Invalid keys in rounding_threshold_bits. Allowed keys are \\['method', 'n_bits'\\].", ), ( {"n_bits": "not_an_int"},