Skip to content

Commit 39e8922

Browse files
committed
INT4 ONNX Version Fix: Code Quality Improvements
Signed-off-by: Hrishith Thadicherla <[email protected]>
1 parent ef69ab7 commit 39e8922

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modelopt/onnx/quantization/int4.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@
9898
# supported and working
9999
CLIP_MIN = 1e-5
100100

101-
def safe_cupy_array(tensor):
101+
def safe_cupy_array(tensor):
102102
"""Convert ml_dtypes.int4 tensor to numpy.int8 for CuPy compatibility.
103-
103+
104104
In ONNX 1.19, int4 tensors use ml_dtypes.int4 which CuPy doesn't support.
105105
This function converts them to regular numpy.int8 while preserving values.
106106
Args:
107-
tensor: numpy array that may have ml_dtypes.int4 dtype
107+
tensor: numpy array that may have ml_dtypes.int4 dtype
108108
Returns:
109-
cupy or numpy array (if cupy is not supported) with numpy.int8 dtype if input was ml_dtypes.int4,
109+
cupy or numpy array (if cupy is not supported) with numpy.int8 dtype if input was ml_dtypes.int4,
110110
otherwise unchanged
111111
"""
112112
try:

0 commit comments

Comments
 (0)