- class ctranslate2.specs.LayerSpec
A layer specification declares the weights that should be set by the converters.
- optimize(quantization: Optional[str] = None) None
Recursively applies some optimizations to this layer:
Alias variables with the same shape and value.
quantization – Weight quantization scheme (possible values are: int8, int8_float16, int16, float16).
- validate() None
Verify that the required weights are set.
ValueError – If a required weight is not set in the specification.
- variables(prefix: str = '', ordered: bool = False) Dict[str, ndarray]
Recursively returns the weights from this layer and its children.
prefix – Prefix to prepend to all variable names.
ordered – If set, an ordered list is returned instead.
Dictionary mapping variables name to value.