(weight_name: str, scale_name: str)
| 317 | tensors = {} |
| 318 | |
| 319 | def load_and_dequantize(weight_name: str, scale_name: str) -> torch.Tensor: |
| 320 | t = weights[weight_name] |
| 321 | if scale_name in weights: |
| 322 | scale = weights[scale_name] |
| 323 | t = blockwise_dequantize(t, scale, dequant_block_size) |
| 324 | return t |
| 325 | |
| 326 | def quantize(t: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: |
| 327 | if dtype not in [torch.float32, torch.float16]: |
no test coverage detected