From 6af02ae06a99e6708bd69a778d3fed85f526383b Mon Sep 17 00:00:00 2001 From: Francesco <69186098+spadacesco@users.noreply.github.com> Date: Sat, 6 Apr 2024 04:48:48 +0200 Subject: [PATCH] Remove non-existing function call (#19416) 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](https://github.com/microsoft/onnxruntime/issues/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](https://github.com/microsoft/onnxruntime/issues/18893 ). --- onnxruntime/python/tools/quantization/calibrate.py | 1 - 1 file changed, 1 deletion(-) diff --git a/onnxruntime/python/tools/quantization/calibrate.py b/onnxruntime/python/tools/quantization/calibrate.py index 971cc203f4d73..ef1ecd20a0d6f 100644 --- a/onnxruntime/python/tools/quantization/calibrate.py +++ b/onnxruntime/python/tools/quantization/calibrate.py @@ -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: