Skip to content

Commit 53b6576

Browse files
authored
[Fix] Fix tvm.tir references in Tflite frontend (#18940)
as per title
1 parent 90e6e8b commit 53b6576

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

python/tvm/relax/frontend/tflite/tflite_frontend.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,8 @@ def quantize(x):
597597

598598
# Get min/max of the output dtype. This will be used to ensure that clip a_min/a_max are not
599599
# beyond the dtype range.
600-
qmin = float(tvm.tir.op.min_value(dtype).value)
601-
qmax = float(tvm.tir.op.max_value(dtype).value)
600+
qmin = float(tvm.tirx.min_value(dtype).value)
601+
qmax = float(tvm.tirx.max_value(dtype).value)
602602

603603
# The input expr is a quantized tensor with its scale and zero point. We calculate the
604604
# suitable clip off points based on these scale and zero point.
@@ -1117,8 +1117,8 @@ def quantize(x):
11171117
# Get min/max of the input dtype. This will be used to ensure that
11181118
# clip a_min/a_max are not beyond the dtype range.
11191119
input_tensor_type_str = self.get_tensor_type_str(input_tensor.tensor.Type())
1120-
qmin = float(tvm.tir.op.min_value(input_tensor_type_str).value)
1121-
qmax = float(tvm.tir.op.max_value(input_tensor_type_str).value)
1120+
qmin = float(tvm.tirx.min_value(input_tensor_type_str).value)
1121+
qmax = float(tvm.tirx.max_value(input_tensor_type_str).value)
11221122

11231123
out = relax.op.clip(
11241124
in_expr, min=max(qmin, quantize(-1.0)), max=min(qmax, quantize(1.0))

0 commit comments

Comments
 (0)