zhreshold commented on a change in pull request #12653: ONNX export: Square and
ReduceSum operators
URL: https://github.com/apache/incubator-mxnet/pull/12653#discussion_r223536812
##########
File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
##########
@@ -2077,3 +2077,82 @@ def convert_sqrt(node, **kwargs):
name=name,
)
return [node]
+
+@mx_op.register("square")
+def convert_square(node, **kwargs):
+ """Map MXNet's square operator attributes to onnx's Pow operator
+ and return the created node.
+ """
+ onnx = import_onnx_modules()
+ name = node["name"]
+ proc_nodes = kwargs["proc_nodes"]
+ inputs = node["inputs"]
+
+ input_node_a_id = kwargs["index_lookup"][inputs[0][0]]
+
+ input_node_a = proc_nodes[input_node_a_id].name
+
+ initializer = kwargs["initializer"]
+ power2 = [2]
+ np_arr = np.array(power2)
Review comment:
what is the point of setting power2 as a temporary variable
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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