From 2c6da0c4308e60a221f9c098a55a2884879f456e Mon Sep 17 00:00:00 2001 From: Tlopex <68688494+tlopex@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:29:32 +0800 Subject: [PATCH 1/3] add quantized arg_min --- python/tvm/relay/frontend/tflite.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/python/tvm/relay/frontend/tflite.py b/python/tvm/relay/frontend/tflite.py index 532318b804da..ef89fe80b75e 100644 --- a/python/tvm/relay/frontend/tflite.py +++ b/python/tvm/relay/frontend/tflite.py @@ -1898,10 +1898,6 @@ def _convert_arg_min_max(self, relay_op, op): def convert_arg_min(self, op): """Convert TFLite ARG_MIN""" - if self.is_quantized(op): - raise tvm.error.OpNotImplemented( - "TFlite quantized ARG_MIN operator is not supported yet." - ) return self._convert_arg_min_max(_op.argmin, op) def convert_arg_max(self, op): From 971002e93adb88eaa2e11f142cdaf7a3a34a1d1b Mon Sep 17 00:00:00 2001 From: Tlopex <68688494+tlopex@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:31:25 +0800 Subject: [PATCH 2/3] add tests for quantized arg_min --- tests/python/frontend/tflite/test_forward.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/python/frontend/tflite/test_forward.py b/tests/python/frontend/tflite/test_forward.py index f60166702454..5e5ae8555548 100644 --- a/tests/python/frontend/tflite/test_forward.py +++ b/tests/python/frontend/tflite/test_forward.py @@ -3264,6 +3264,7 @@ def test_forward_arg_min_max(): # There is no quantized version of ArgMin for axis in [None, 0, 1, -1]: _test_arg_min_max(math_ops.argmax, data, axis, True) + _test_arg_min_max(math_ops.argmin, data, axis, True) for data in [np.array(np.random.uniform(-100, 100, (3, 4)), dtype=np.float32)]: for axis in [None, 0, 1, -1]: From 87fab6bb3f0d8743d95d8fbb97a7264596bcc8c2 Mon Sep 17 00:00:00 2001 From: Tlopex <68688494+tlopex@users.noreply.github.com> Date: Fri, 13 Oct 2023 00:14:24 +0800 Subject: [PATCH 3/3] delete the annotation --- tests/python/frontend/tflite/test_forward.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/python/frontend/tflite/test_forward.py b/tests/python/frontend/tflite/test_forward.py index 5e5ae8555548..7adcdbd64404 100644 --- a/tests/python/frontend/tflite/test_forward.py +++ b/tests/python/frontend/tflite/test_forward.py @@ -3261,7 +3261,6 @@ def test_forward_arg_min_max(): """Arg min max""" # test quantized for data in [np.array(np.random.uniform(-100, 100, (3, 4)), dtype=np.uint8)]: - # There is no quantized version of ArgMin for axis in [None, 0, 1, -1]: _test_arg_min_max(math_ops.argmax, data, axis, True) _test_arg_min_max(math_ops.argmin, data, axis, True)