(self, config: Dict)
| 48 | class Quantizer: |
| 49 | |
| 50 | def __init__(self, config: Dict) -> None: |
| 51 | self.config = config |
| 52 | assert self.config['num_bits'] == 4 or self.config[ |
| 53 | 'num_bits'] == 8, 'Only INT4 and INT8 quantization is supported.' |
| 54 | assert self.config['symmetric'] == False, 'Only asymmetric quantization is supported at this moment.' |
| 55 | |
| 56 | def quantize(self, tensor: Tensor) -> Tuple[Tensor, Tensor, Tensor]: |
| 57 | assert tensor.shape[self.config['group_dim']] % self.config['group_size'] == 0 \ |
nothing calls this directly
no outgoing calls
no test coverage detected