Skip to content

Commit f970195

Browse files
committed
updated intNwo with _get_linear_subclass_inserter
1 parent 9af3404 commit f970195

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

torchao/quantization/prototype/mixed_precision/scripts/naive_intNwo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
)
77

88
from torchao.quantization import int8_weight_only, int4_weight_only
9-
9+
from torchao.quantization.quant_api import _get_linear_subclass_inserter
1010

1111
def intN_weight_only(group_size=32, n=8, symmetric=False):
1212
'''
@@ -52,9 +52,9 @@ def apply_intN_weight_only_quant_sym(weight):
5252
return int4_weight_only(group_size=group_size)
5353
else:
5454
if symmetric:
55-
return apply_intN_weight_only_quant_sym
55+
return _get_linear_subclass_inserter(apply_intN_weight_only_quant_sym)
5656
else:
57-
return apply_intN_weight_only_quant_asym
57+
return _get_linear_subclass_inserter(apply_intN_weight_only_quant_asym)
5858
except Exception as e:
5959
raise
6060

0 commit comments

Comments
 (0)