Skip to content

Commit

Permalink
Pass in final value of reduce_range to quantize_initializer() function
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlizarraga committed Nov 20, 2023
1 parent c452352 commit c0b95f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions onnxruntime/python/tools/quantization/onnx_quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ def __quantize_inputs(
quant_type = quant_overrides["quant_type"].tensor_type

symmetric = quant_overrides.get("symmetric", self.is_weight_symmetric)
reduce_range = quant_overrides.get("reduce_range", reduce_range)
reduce_range = quant_overrides.get("reduce_range", reduce_range and self.reduce_range)

q_weight_name, zp_name, scale_name = self.quantize_initializer(
initializer, quant_type, reduce_range=reduce_range, symmetric=symmetric
Expand Down Expand Up @@ -1008,7 +1008,7 @@ def quantize_initializer(self, weight, qType, reduce_range=False, keep_float_wei
w_data,
qType,
symmetric,
self.reduce_range and reduce_range,
reduce_range,
self.min_real_range,
)

Expand Down

0 comments on commit c0b95f2

Please sign in to comment.