diff --git a/neural_compressor/adaptor/ox_utils/calibration.py b/neural_compressor/adaptor/ox_utils/calibration.py index d7dceed4d60..599fe9f880a 100644 --- a/neural_compressor/adaptor/ox_utils/calibration.py +++ b/neural_compressor/adaptor/ox_utils/calibration.py @@ -440,8 +440,9 @@ def get_weight_tensors_calib_range(self): ), ) calibrator = CALIBRATOR["minmax"]() # use minmax method to calibrate initializer tensors - calibrator.collect(initializer_tensor) - weight_tensors_calib_range[initializer_tensor_name] = [list(calibrator.calib_range)] + if initializer_tensor.flatten().size > 0: + calibrator.collect(initializer_tensor) + weight_tensors_calib_range[initializer_tensor_name] = [list(calibrator.calib_range)] calibrator.clear() del calibrator return weight_tensors_calib_range