File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
modelopt/onnx/quantization Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 9898# supported and working
9999CLIP_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 :
You can’t perform that action at this time.
0 commit comments