(weight)
| 951 | return x.to(dtype) |
| 952 | |
| 953 | def weight_quant(weight): |
| 954 | weight = torch.tensor(weight, dtype=torch.float32) |
| 955 | weight = forward_t(weight) |
| 956 | # Use tolist() then convert to numpy to avoid PyTorch-NumPy compatibility issues |
| 957 | weight = np.array(weight.tolist(), dtype=np.float32) |
| 958 | return weight |
| 959 | |
| 960 | def part_lazy_q(lazy_tensor: LazyTensor, n_part: int) -> LazyTensor: |
| 961 | def load() -> Tensor: |