waytrue17 commented on a change in pull request #19736:
URL: https://github.com/apache/incubator-mxnet/pull/19736#discussion_r558634473



##########
File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
##########
@@ -3023,3 +3031,22 @@ def convert_contrib_box_decode(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:

Review comment:
       Yes, when `len(output_size) > 2`, mxnet will perform the calculation 
with ` output_size = 1`. This check is to handle that.




----------------------------------------------------------------
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]


Reply via email to