neural_compressor.experimental.common¶
Intel® Neural Compressor: An open-source Python library supporting common model.
Submodules¶
neural_compressor.experimental.common.criterionneural_compressor.experimental.common.dataloaderneural_compressor.experimental.common.metricneural_compressor.experimental.common.modelneural_compressor.experimental.common.optimizerneural_compressor.experimental.common.postprocessneural_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:
objectA 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:
objectA 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:
objectJust collect the infos to construct a Postprocess.
- class neural_compressor.experimental.common.Metric(metric_cls, name='user_metric', **kwargs)¶
Bases:
objectA 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.