FrozenGene commented on a change in pull request #4695: [Relay][Frontend][TFlite] Add parser support for relational ops URL: https://github.com/apache/incubator-tvm/pull/4695#discussion_r371276409
########## File path: python/tvm/relay/frontend/tflite.py ########## @@ -705,47 +710,77 @@ def convert_div(self, op): # Check if the input tensor is quantized, call QNN op if self.is_quantized(op): raise tvm.error.OpNotImplemented( - 'TFlite quantized div operator is not supported yet.') + 'TFlite quantized DIV operator is not supported yet.') return self._convert_elemwise(_op.divide, op) def convert_pow(self, op): # Check if the input tensor is quantized, call QNN op if self.is_quantized(op): raise tvm.error.OpNotImplemented( - 'TFlite quantized pow operator is not supported yet.') + 'TFlite quantized POW operator is not supported yet.') return self._convert_elemwise(_op.power, op) + def convert_squared_difference(self, op): + # Check if the input tensor is quantized, call QNN op + if self.is_quantized(op): + raise tvm.error.OpNotImplemented( + 'TFlite quantized SQUARED_DIFFERENCE operator is not supported yet.') + difference = self._convert_elemwise(_op.subtract, op) + # _convert_elemwise has guaranteed only have one output tensor + exp_type = self.get_tensor_type_str(self.get_output_tensors(op)[0].tensor.Type()) + out = _op.power(difference, relay.const(2, exp_type)) + return out + def convert_maximum(self, op): # Check if the input tensor is quantized, call QNN op if self.is_quantized(op): raise tvm.error.OpNotImplemented( - 'TFlite quantized maximum operator is not supported yet.') + 'TFlite quantized MAXIMUM operator is not supported yet.') return self._convert_elemwise(_op.maximum, op) def convert_minimum(self, op): # Check if the input tensor is quantized, call QNN op if self.is_quantized(op): raise tvm.error.OpNotImplemented( - 'TFlite quantized minimum operator is not supported yet.') + 'TFlite quantized MINIMUM operator is not supported yet.') return self._convert_elemwise(_op.minimum, op) def convert_greater(self, op): # Check if the input tensor is quantized, call QNN op if self.is_quantized(op): raise tvm.error.OpNotImplemented( - 'TFlite quantized greater operator is not supported yet.') + 'TFlite quantized GREATER operator is not supported yet.') return self._convert_elemwise(_op.greater, op) - def convert_squared_difference(self, op): - # Check if the input tensor is quantized, call QNN op + def convert_greater_equal(self, op): Review comment: add such a doc string to every elemwise function. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services