Skip to content

Commit

Permalink
Remove non-existing function call (#19416)
Browse files Browse the repository at this point in the history
This function call is confusing, since it is a function call without
definition of the function. It was correctly repalced from compute_data
to compute_range, but function call was reintroudced in a later PR.

### Description
Problem as described in [this
issue](#18893 )

In the examples, different calls of compute_range() from calibrate.py
can be found, also in the calibrate.py itself.

The problem is that it was [replaced here]
(https://github.com/microsoft/onnxruntime/pull/16550/files#diff-75e84436a983e17527f8b5bc585087e7ad75b3b515c2101c2a82dcaecca490de
) from `compute_range()` to `cpmute_data() -> TensorsData` and then
falsely [added as call
here](https://github.com/microsoft/onnxruntime/pull/17029/files#diff-75e84436a983e17527f8b5bc585087e7ad75b3b515c2101c2a82dcaecca490de
).

### Motivation and Context
I suggest in this PR to remove this confusing call
`self.calibrate_range()` in calibrate.py. Once it is removed and
packaged, somehow the examples from the onnx-runtime-examples repository
must be adapted, since they are already not working. Examples of
`compute_range()` in the examples are linked in [this
issue](#18893 ).
  • Loading branch information
spadacesco authored Apr 6, 2024
1 parent 05d97e8 commit 6af02ae
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion onnxruntime/python/tools/quantization/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ def collect_data(self, data_reader: CalibrationDataReader):
self.max_intermediate_outputs is not None
and len(self.intermediate_outputs) == self.max_intermediate_outputs
):
self.compute_range()
self.clear_collected_data()

if len(self.intermediate_outputs) == 0 and self.calibrate_tensors_range is None:
Expand Down

0 comments on commit 6af02ae

Please sign in to comment.