quantizer = Quantization(conf.yaml)
quantizer.model = common.Model('/path/to/model')
dl = dataset('/path/to/dataset')
quantizer.calib_dataloader = common.DataLoader(dl, batch_size=32)
quantizer.eval_dataloader = common.DataLoader(dl, batch_size=32)
quantizer.metric = common.Metric(custom_metric)
q_model = quantizer()
q_model.save('/path/to/output/dir') explicitly call to save q_model
Built-in transform/dataset/metric APIs
v1.2 refines LPOT built-in transform/dataset/metric to unify APIs cross different framework backends.
Refer to [dataset](./dataset.md), [transform](./transform.md), and [metric](./metric.md) to learn how to use them in yaml or code.