lhutton1 commented on a change in pull request #9384:
URL: https://github.com/apache/tvm/pull/9384#discussion_r739111504
##########
File path: python/tvm/relay/op/contrib/ethosu.py
##########
@@ -331,6 +332,133 @@ def qnn_depthwise_conv2d_pattern() ->
tvm.relay.dataflow_pattern.DFPattern:
return clip_or_req
+class MaxPool2DParams:
+ """
+ This class will parse a call to a ethosu.maxpool2d composite function
+ and extract the parameter information.
+ """
+
+ composite_name = "ethosu.maxpool2d"
+ # The hardware only supports padding upto the numbers as follows
+ padding_bounds = [127, 127, 128, 128]
+
+ def __init__(self, func_body: Call):
+ clip = None
+ if str(func_body.op) == "clip":
+ clip = func_body
+ pool_op = clip.args[0]
+ else:
+ pool_op = func_body
+
+ attrs = pool_op.attrs
+ self.ifm = TensorParams(pool_op.args[MaxPoolArgs.ifm.value],
attrs.layout)
+ self.ofm = TensorParams(pool_op, attrs.layout)
+ self.pool_shape = [int(i) for i in attrs.pool_size]
Review comment:
Yep you're correct apologies, I'm still not sure its needed though,
```
>>>print(type(attrs.strides))
<class 'tvm.ir.container.Array'>
```
Changing to just `attrs.pool_size` locally I'm able to get the codegen tests
to pass
--
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]