Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -2690,11 +2690,7 @@ def convert_floor_div(self, op):

def convert_floor_mod(self, op):
"""Convert TFLite FLOOR_MOD"""
if self.is_quantized(op):
raise tvm.error.OpNotImplemented(
"TFlite quantized FLOOR MOD operator is not supported yet."
)
return self._convert_elemwise(_op.floor_mod, op)
return self._convert_elemwise(_op.floor_mod, op, self.is_quantized(op))

def convert_mirror_pad(self, op):
"""Convert TFLite MIRROR_PAD"""
Expand Down
13 changes: 11 additions & 2 deletions tests/python/frontend/tflite/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -2764,9 +2764,16 @@ def _test_floor_divide(data, fused_activation_function=None, quantized=False, qn
# ---------


def _test_floor_mod(data):
def _test_floor_mod(data, fused_activation_function=None, quantized=False, qnn_op=None):
"""One iteration of floor_mod"""
return _test_elemwise(math_ops.floormod, data)
return _test_elemwise(
math_ops.floormod,
data,
fused_activation_function,
quantized,
qnn_op,
same_qnn_params=True,
)


def _test_forward_elemwise(testop):
Expand Down Expand Up @@ -2816,6 +2823,7 @@ def _test_elemwise_qnn_out_range(qnn_op):
_test_greater: (-150, 150),
_test_squared_difference: (0, 65025),
_test_floor_divide: (-150, 150),
_test_floor_mod: (-150, 150),
}

return qnn_out_range[qnn_op]
Expand Down Expand Up @@ -2859,6 +2867,7 @@ def test_all_elemwise():
_test_forward_elemwise(_test_floor_divide)
_test_forward_elemwise_quantized(_test_floor_divide)
_test_forward_elemwise(_test_floor_mod)
_test_forward_elemwise_quantized(_test_floor_mod)


#######################################################################
Expand Down