Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions python/tvm/relay/frontend/tflite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1486,11 +1486,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"""
Expand Down
14 changes: 12 additions & 2 deletions tests/python/frontend/tflite/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -2707,9 +2707,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,
)


#######################################################################
Expand Down Expand Up @@ -2850,6 +2858,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),
}

return qnn_out_range[qnn_op]
Expand Down Expand Up @@ -2888,6 +2897,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)
Expand Down