(self, weight)
| 25 | |
| 26 | |
| 27 | class QuantTemplate(metaclass=ABCMeta): |
| 28 | def __init__(self, weight): |
| 29 | if weight.dim() != 2: |
| 30 | raise ValueError(f"Only 2D tensors supported. Got {weight.dim()}D tensor") |
| 31 | if torch.isnan(weight).any(): |
| 32 | raise ValueError("Tensor contains NaN values") |