Commit 21353e5f by Ina Dobreva Committed by Tianqi Chen

add parser support for GREATER tflite operator (#3963)

add test for GREATER
parent b410df8c
......@@ -74,6 +74,7 @@ class OperatorConverter(object):
'POW': self.convert_pow,
'MAXIMUM': self.convert_maximum,
'MINIMUM': self.convert_minimum,
'GREATER': self.convert_greater,
'REDUCE_MIN': self._convert_reduce_min,
'REDUCE_MAX': self._convert_reduce_max,
'MEAN': self._convert_reduce_mean,
......@@ -456,6 +457,9 @@ class OperatorConverter(object):
def convert_minimum(self, op):
return self._convert_elemwise(_op.minimum, op)
def convert_greater(self, op):
return self._convert_elemwise(_op.greater, op)
def _convert_reduce(self, relay_op, op):
"""Generic method to Convert TFLite MEAN operators"""
try:
......
......@@ -597,6 +597,13 @@ def _test_maximum(data):
def _test_minimum(data):
""" One iteration of minimum """
return _test_elemwise(math_ops.minimum, data)
#######################################################################
# Greater
# -------
def _test_greater(data):
""" One iteration of greater """
return _test_elemwise(math_ops.greater, data)
def _test_forward_elemwise(testop):
""" Elewise"""
......@@ -623,6 +630,7 @@ def test_all_elemwise():
_test_forward_elemwise(_test_pow)
_test_forward_elemwise(_test_maximum)
_test_forward_elemwise(_test_minimum)
_test_forward_elemwise(_test_greater)
#######################################################################
# Reduce
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment