MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / Spec

Class Spec

python/tests/test_spec.py:17–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15 self.a = np.ones([5], dtype=np.float16)
16
17 class Spec(ctranslate2.specs.LayerSpec):
18 def __init__(self):
19 self.a = np.zeros([5], dtype=np.float32)
20 self.b = np.zeros([5], dtype=np.float16)
21 self.c = np.zeros([5], dtype=np.int32)
22 self.d = OPTIONAL
23 self.e = SubSpec()
24 self.f = True
25 self.g = "hello"
26
27 spec = Spec()
28 spec.validate()

Callers 5

test_layer_spec_validateFunction · 0.85
test_layer_spec_optimizeFunction · 0.85
test_int8_quantizationFunction · 0.85
test_fp16_weightsFunction · 0.85

Calls

no outgoing calls

Tested by 5

test_layer_spec_validateFunction · 0.68
test_layer_spec_optimizeFunction · 0.68
test_int8_quantizationFunction · 0.68
test_fp16_weightsFunction · 0.68