(self, tensor, scales, zeros, qmax, qmin)
| 131 | self.dst_nbins = 2**bit |
| 132 | |
| 133 | def quant(self, tensor, scales, zeros, qmax, qmin): |
| 134 | tensor = torch.clamp(torch.round(tensor / scales) + zeros, qmin, qmax) |
| 135 | return tensor |
| 136 | |
| 137 | def dequant(self, tensor, scales, zeros): |
| 138 | tensor = (tensor - zeros) * scales |