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)