vandanavk commented on a change in pull request #13500: [MXNET-898] ONNX 
import/export: Sample_multinomial, ONNX export: Gather, GlobalLpPool, LpPool
URL: https://github.com/apache/incubator-mxnet/pull/13500#discussion_r242371031
 
 

 ##########
 File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
 ##########
 @@ -1655,3 +1678,45 @@ def convert_size(node, **kwargs):
     and return the created node.
     """
     return create_basic_op_node('Size', node, kwargs)
+
+@mx_op.register("_sample_multinomial")
+def convert_multinomial(node, **kwargs):
+    """Map MXNet's multinomial operator attributes to onnx's
+    Multinomial operator and return the created node.
+    """
+    name, input_nodes, attrs = get_inputs(node, kwargs)
+    dtype = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[np.dtype(attrs.get("dtype", 
'int32'))]
+    sample_size = convert_string_to_list(attrs.get("shape", '1'))
 
 Review comment:
   shape can be [] which would mean that one sample is drawn

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

Reply via email to