diff --git a/python/tvm/relay/frontend/tflite.py b/python/tvm/relay/frontend/tflite.py index 9e72049ecda5..4eaa8280c307 100644 --- a/python/tvm/relay/frontend/tflite.py +++ b/python/tvm/relay/frontend/tflite.py @@ -1484,11 +1484,7 @@ def convert_less(self, op): def convert_less_equal(self, op): """Convert TFLite LESS_EQUAL""" - if self.is_quantized(op): - raise tvm.error.OpNotImplemented( - "TFlite quantized LESS_EQUAL operator is not supported yet." - ) - return self._convert_elemwise(_op.less_equal, op) + return self._convert_elemwise(_op.less_equal, op, self.is_quantized(op), comparison_op=True) def convert_equal(self, op): """Convert TFLite EQUAL""" diff --git a/tests/python/frontend/tflite/test_forward.py b/tests/python/frontend/tflite/test_forward.py index b981145c1cb8..f1e2e28f086b 100644 --- a/tests/python/frontend/tflite/test_forward.py +++ b/tests/python/frontend/tflite/test_forward.py @@ -2715,9 +2715,17 @@ def _test_less(data, fused_activation_function=None, quantized=False, qnn_op=Non # ---------- -def _test_less_equal(data): +def _test_less_equal(data, fused_activation_function=None, quantized=False, qnn_op=None): """One iteration of less_equal""" - return _test_elemwise(math_ops.less_equal, data) + return _test_elemwise( + math_ops.less_equal, + data, + fused_activation_function, + quantized, + qnn_op, + same_qnn_params=True, + comparison_op=True, + ) ####################################################################### @@ -2858,6 +2866,7 @@ def _test_elemwise_qnn_out_range(qnn_op): _test_less: (-150, 150), _test_floor_mod: (-150, 150), _test_not_equal: (-150, 150), + _test_less_equal: (-150, 150), _test_greater_equal: (-150, 150), } @@ -2898,6 +2907,7 @@ def test_all_elemwise(): _test_forward_elemwise(_test_less) _test_forward_elemwise_quantized(_test_less) _test_forward_elemwise(_test_less_equal) + _test_forward_elemwise_quantized(_test_less_equal) _test_forward_elemwise(_test_equal) _test_forward_elemwise_quantized(_test_equal) _test_forward_elemwise(_test_not_equal)