diff --git a/torchao/quantization/subclass.py b/torchao/quantization/subclass.py index 8978cb7ce4..55877ee974 100644 --- a/torchao/quantization/subclass.py +++ b/torchao/quantization/subclass.py @@ -231,7 +231,7 @@ class Int8DynamicallyQuantizedLinearWeight(QuantizedLinearWeightBase): @staticmethod def __new__(cls, int_data, q_scales, transposed, shape, dtype=None, **kwargs): if dtype is None: - dtype = qscales.dtype + dtype = q_scales.dtype kwargs["dtype"] = dtype return super().__new__(cls, int_data, transposed, shape, **kwargs) # type: ignore[attr-defined]