MCPcopy Create free account
hub / github.com/TabbyML/tabby / test_layer_spec_validate_unset

Function test_layer_spec_validate_unset

python/tests/test_spec.py:43–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41
42
43def test_layer_spec_validate_unset():
44 class SubSpec(ctranslate2.specs.LayerSpec):
45 def __init__(self):
46 self.attr_1 = None
47
48 class Spec(ctranslate2.specs.LayerSpec):
49 def __init__(self):
50 self.attr_1 = np.zeros([5], dtype=np.float32)
51 self.attr_2 = None
52 self.attr_3 = SubSpec()
53
54 spec = Spec()
55
56 with pytest.raises(ValueError, match="attr_2\nattr_3.attr_1"):
57 spec.validate()
58
59
60def test_layer_spec_optimize():

Callers

nothing calls this directly

Calls 2

SpecClass · 0.85
validateMethod · 0.45

Tested by

no test coverage detected