coreai_opt.config.spec.CompressionComponentFactoryBase¶
- class coreai_opt.config.spec.CompressionComponentFactoryBase[source]¶
Bases:
ABCAbstract base class for compression component factories.
This factory provides a generic interface for creating compression components from CompressionSpec instances. Different compression techniques (quantization, palettization, etc.) should extend this base class to provide their specific implementations.
- __init__()¶
Methods
construct(spec, target)Create a compression component instance from a CompressionSpec.
construct_partial(spec, target)Create a compression component partial object for deferred construction.
- abstract classmethod construct(spec, target)[source]¶
Create a compression component instance from a CompressionSpec.
- Parameters:
spec (CompressionSpec | None) – CompressionSpec instance containing configuration
target (CompressionTargetTensor) – The target tensor for compression (weight or activation)
- Returns:
CompressionSimulatorBase instance configured from the spec
- Return type:
CompressionSimulatorBase | None
- abstract classmethod construct_partial(spec, target)[source]¶
Create a compression component partial object for deferred construction.
- Parameters:
spec (CompressionSpec | None) – CompressionSpec instance containing configuration
target (CompressionTargetTensor) – The target tensor for compression (weight or activation)
- Returns:
- A partial object that can be used for deferred
construction of CompressionSimulatorBase instances.
- Return type:
PartialConstructor