arina-grovety commented on code in PR #14765:
URL: https://github.com/apache/tvm/pull/14765#discussion_r1196352564
##########
python/tvm/relay/backend/contrib/ethosu/legalize.py:
##########
@@ -1447,6 +1447,84 @@ def callback(
)
+class ChannelPadRewriter(DFPatternCallback):
+ """Convert ethos-u.pad2d composite function to the Relay concatenate
operation"""
+
+ def __init__(self):
+ super().__init__(require_type=True)
+ self.pattern = (
+ wildcard().has_attr({"Composite":
ethosu_patterns.ChannelPadParams.composite_name})
+ )(wildcard())
+
+ def callback(
+ self, pre: tvm.relay.Expr, post: tvm.relay.Expr, node_map:
tvm.ir.container.Map
+ ) -> tvm.relay.Expr:
+ params = ethosu_patterns.ChannelPadParams(post.op.body)
+ params.ifm.tensor = post.args[0]
+
+ concat_args = list()
+ # Activations requiring LUT is currently not supported, so setting it
to an empty list
Review Comment:
Got it, thank you.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]