(self, tensor, allow_padding=False)
| 75 | return scales, zeros, qmax, qmin |
| 76 | |
| 77 | def reshape_tensor(self, tensor, allow_padding=False): |
| 78 | if self.granularity == "per_group": |
| 79 | t = tensor.reshape(-1, self.group_size) |
| 80 | else: |
| 81 | t = tensor |
| 82 | return t |
| 83 | |
| 84 | def restore_tensor(self, tensor, shape): |
| 85 | if tensor.shape == shape: |