1# mypy: allow-untyped-defs 2import torch 3from torch.ao.quantization.experimental.quantizer import APoTQuantizer 4 5 6# class to store APoT quantized tensor 7class TensorAPoT: 8 quantizer: APoTQuantizer 9 data: torch.Tensor 10 11 def __init__(self, quantizer: APoTQuantizer, apot_data: torch.Tensor): 12 self.quantizer = quantizer 13 self.data = apot_data 14 15 def int_repr(self): 16 return self.data 17