@@ -90,8 +90,8 @@ def test_to_device(self, apply_quant):
90
90
@unittest .skipIf (not torch .cuda .is_available (), "Need CUDA available" )
91
91
def test_register_new_dispatch (self ):
92
92
from torchao .dtypes .affine_quantized_tensor import (
93
- _register_aqt_quantized_linear_dispatch ,
94
- _deregister_aqt_quantized_linear_dispatch ,
93
+ register_aqt_quantized_linear_dispatch ,
94
+ deregister_aqt_quantized_linear_dispatch ,
95
95
)
96
96
from torchao .dtypes import to_affine_quantized_intx
97
97
from torchao .dtypes import AffineQuantizedTensor
@@ -109,7 +109,7 @@ def impl(input_tensor, weight_tensor, bias):
109
109
# quantized linear operator here
110
110
assert False , "dispatching to my impl for uint6 weight only quant"
111
111
112
- _register_aqt_quantized_linear_dispatch (dispatch_condition , impl )
112
+ register_aqt_quantized_linear_dispatch (dispatch_condition , impl )
113
113
114
114
def apply_uint6_weight_only_quant (linear ):
115
115
linear .weight = torch .nn .Parameter (to_affine_quantized_intx (linear .weight , MappingType .ASYMMETRIC , (1 , linear .weight .shape [- 1 ]), torch .uint8 , 0 , 2 ** 6 - 1 ), requires_grad = False )
@@ -122,7 +122,7 @@ def apply_uint6_weight_only_quant(linear):
122
122
with self .assertRaisesRegex (AssertionError , "dispatching to my impl for uint6 weight only quant" ):
123
123
l (example_input )
124
124
125
- _deregister_aqt_quantized_linear_dispatch (dispatch_condition )
125
+ deregister_aqt_quantized_linear_dispatch (dispatch_condition )
126
126
127
127
128
128
0 commit comments