# Define a customized Metric function
from lpot.experimental import Quantization, common
from lpot.experimental.metric import BaseMetric


class MyMetric(BaseMetric):
    def __init__(self, *args):
        pass

    def update(self, predict, label):
        pass

    def reset(self):
        pass

    def result(self):
        pass

# Quantize with customized dataloader and metric
quantizer = Quantization('{{config_path}}')
quantizer.model = common.Model('{{model_path}}')
quantizer.metric = common.Metric(metric_cls=MyMetric, name='my_metric')
quantized_model = quantizer()
quantized_model.save('{{model_output_path}}')
