wyc-ruiker commented on a change in pull request #4822: [Frontend][TFLite] Add
MIRROR_PAD operator
URL: https://github.com/apache/incubator-tvm/pull/4822#discussion_r375629498
##########
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:
I think this exception will not be triggered when quantized MIRROR_PAD is
not implemented by TFLite. If the exception is triggered, it certainly means
the TVM stack doesn't support quantized MIRROR_PAD.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services