u99127 commented on a change in pull request #4822: [Frontend][TFLite] Add MIRROR_PAD operator URL: https://github.com/apache/incubator-tvm/pull/4822#discussion_r375518286
########## File path: python/tvm/relay/frontend/tflite.py ########## @@ -1422,10 +1423,48 @@ def convert_pad(self, op): # convert list of lists to tuple of tuples paddings = tuple(tuple(l) for l in pad_list) - # Use default pad_value 0 because TFLite does not support constant_values parameter + # Use default pad_value 0 because TFLite PAD does not support constant_values parameter out = _op.nn.pad(in_expr, paddings) return out + def convert_mirror_pad(self, op): + """Convert TFLite MIRROR_PAD""" + try: + from tflite.Operator import Operator + from tflite.BuiltinOptions import BuiltinOptions + from tflite.MirrorPadOptions import MirrorPadOptions + except ImportError: + raise ImportError("The tflite package must be installed") + + # the quantized form MirrorPad is not yet implemented in TFLite. + if self.is_quantized(op): + raise tvm.error.OpNotImplemented( + 'TFlite quantized MIRROR_PAD operator is not supported yet.') Review comment: Pedantry : A not implemented error suggests to me as a user that the support exists in the tflite tooling but the TVM stack has not yet implemented the support i.e. the tflite tooling can't yet produce the mirror_pad operation, do we need a different notification here actually asking the user to report an issue asking for a feature to be added ? ---------------------------------------------------------------- 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