neural_compressor.experimental.common
¶
Intel® Neural Compressor: An open-source Python library supporting common model.
Submodules¶
neural_compressor.experimental.common.criterion
neural_compressor.experimental.common.dataloader
neural_compressor.experimental.common.metric
neural_compressor.experimental.common.model
neural_compressor.experimental.common.optimizer
neural_compressor.experimental.common.postprocess
neural_compressor.experimental.common.torch_utils
Package Contents¶
Classes¶
A wrapper of the information needed to construct a Model. |
|
A wrapper of the information needed to construct a dataloader. |
|
Just collect the infos to construct a Postprocess. |
|
A wrapper of the information needed to construct a Metric. |
Functions¶
|
Generate common dataloader. |
- class neural_compressor.experimental.common.Model¶
Bases:
object
A wrapper of the information needed to construct a Model.
- class neural_compressor.experimental.common.DataLoader(dataset, batch_size=1, collate_fn=None, last_batch='rollover', sampler=None, batch_sampler=None, num_workers=0, pin_memory=False, shuffle=False, distributed=False)¶
Bases:
object
A wrapper of the information needed to construct a dataloader.
This class can’t yield batched data and only in this Quantization/Benchmark object’s setter method a ‘real’ calib_dataloader will be created, the reason is we have to know the framework info and only after the Quantization/Benchmark object created then framework infomation can be known. Future we will support creating iterable dataloader from neural_compressor.experimental.common.DataLoader
- class neural_compressor.experimental.common.Postprocess(postprocess_cls, name='user_postprocess', **kwargs)¶
Bases:
object
Just collect the infos to construct a Postprocess.
- class neural_compressor.experimental.common.Metric(metric_cls, name='user_metric', **kwargs)¶
Bases:
object
A wrapper of the information needed to construct a Metric.
The metric class should take the outputs of the model as the metric’s inputs, neural_compressor built-in metric always take (predictions, labels) as inputs, it’s recommended to design metric_cls to take (predictions, labels) as inputs.