From 9a4fb5238fdef76b2fdc821ff1743d30bc7ced4e Mon Sep 17 00:00:00 2001 From: Roman Bredehoft Date: Wed, 10 Jul 2024 14:47:03 +0200 Subject: [PATCH] chore: fix test_serialization_type --- src/concrete/ml/pytest/utils.py | 3 ++- tests/common/test_serialization.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/concrete/ml/pytest/utils.py b/src/concrete/ml/pytest/utils.py index 573a5ac82..d13c94f86 100644 --- a/src/concrete/ml/pytest/utils.py +++ b/src/concrete/ml/pytest/utils.py @@ -612,11 +612,12 @@ def check_serialization( dump_method_to_test = [False] # If the given object provides a `dump`, `dumps` `dump_dict` method (which indicates that they - # are Concrete ML serializable classes), run the check using these as well + # are Concrete ML serializable classes) and are instantiated, run the check using these as well if ( hasattr(object_to_serialize, "dump") and hasattr(object_to_serialize, "dumps") and hasattr(object_to_serialize, "dump_dict") + and not isinstance(object_to_serialize, type) ): dump_method_to_test.append(True) diff --git a/tests/common/test_serialization.py b/tests/common/test_serialization.py index ba8a7f7c9..eebe4cd08 100644 --- a/tests/common/test_serialization.py +++ b/tests/common/test_serialization.py @@ -218,7 +218,6 @@ def test_serialize_numpy_array(dtype): ) def test_serialize_type(value): """Test serialization of type objects (trusted by Skops).""" - value = torch.nn.modules.activation.ReLU check_serialization(value, type, check_str=False)