We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01d966b commit cd6d244Copy full SHA for cd6d244
neural_compressor/adaptor/ox_utils/calibration.py
@@ -440,8 +440,9 @@ def get_weight_tensors_calib_range(self):
440
),
441
)
442
calibrator = CALIBRATOR["minmax"]() # use minmax method to calibrate initializer tensors
443
- calibrator.collect(initializer_tensor)
444
- weight_tensors_calib_range[initializer_tensor_name] = [list(calibrator.calib_range)]
+ if initializer_tensor.flatten().size > 0:
+ calibrator.collect(initializer_tensor)
445
+ weight_tensors_calib_range[initializer_tensor_name] = [list(calibrator.calib_range)]
446
calibrator.clear()
447
del calibrator
448
return weight_tensors_calib_range
0 commit comments