xref: /aosp_15_r20/external/pytorch/torch/ao/quantization/experimental/APoT_tensor.py (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
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