josephevans commented on a change in pull request #19736:
URL: https://github.com/apache/incubator-mxnet/pull/19736#discussion_r554237600
##########
File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
##########
@@ -2725,3 +2725,22 @@ def convert_arange(node, **kwargs):
]
return nodes
+
+@mx_op.register("_contrib_AdaptiveAvgPooling2D")
+def convert_contrib_AdaptiveAvgPooling2D(node, **kwargs):
+ """Map MXNet's _contrib_BilinearResize2D operator attributes to onnx's
operator.
+ """
+ from onnx.helper import make_node
+ name, input_nodes, attrs = get_inputs(node, kwargs)
+
+ output_size = attrs.get('output_size', '1')
+ output_size = convert_string_to_list(output_size)
+
+ if len(output_size) <= 2:
+ if output_size[0] != 1 or (len(output_size) == 2 and output_size[1] !=
1):
+ raise NotImplementedError("_contrib_AdaptiveAvgPooling2D operator
with output_size != 1 \
+ not yet implemented.")
+ nodes = [
+ make_node("GlobalAveragePool", [input_nodes[0]], [name])
Review comment:
I think you also need to assign name=name here as the last node.
----------------------------------------------------------------
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]