anirudhacharya commented on a change in pull request #12646: ONNX export: Fully
connected operator w/o bias, ReduceSum, Square
URL: https://github.com/apache/incubator-mxnet/pull/12646#discussion_r224595370
##########
File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
##########
@@ -2077,3 +2112,79 @@ 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"]
+ np_arr = np.array([2])
+ data_type = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[np_arr.dtype]
Review comment:
use np.int64 here
----------------------------------------------------------------
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