You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/12/15 21:19:13 UTC

[GitHub] [incubator-mxnet] Zha0q1 commented on a change in pull request #19661: [WIP] Support _contrib_interleaved_matmul_selfatt_valatt to ONNX

Zha0q1 commented on a change in pull request #19661:
URL: https://github.com/apache/incubator-mxnet/pull/19661#discussion_r543692213



##########
File path: python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
##########
@@ -1656,16 +1657,15 @@ def convert_slice_axis(node, **kwargs):
     if not ends or ends == 'None':
         # ONNX doesn't support None for ends. Since ends=None depicts
         # length of dimension, passing dimension in this case.
-        in_shape = kwargs['in_shape'][0]
-        ends = in_shape[axes]
+        ends = sys.maxsize

Review comment:
       I rewrote conversion logic for slice_axis with the new onnx slice so you might need to rebase to my pr.
   https://github.com/apache/incubator-mxnet/pull/19677

##########
File path: tests/python-pytest/onnx/test_operators.py
##########
@@ -98,11 +98,14 @@ def test_onnx_export_arange_like(tmp_path, dtype):
 
 
 def test_onnx_export_layernorm(tmp_path):
-    M = def_model('LayerNorm', axis=1)
-    x = mx.nd.array([[1,3],[2,4]], dtype='float32')
-    gamma = mx.random.uniform(0, 1, x[0].shape, dtype='float32')
-    beta = mx.random.uniform(0, 1, x[0].shape, dtype='float32')
-    op_export_test('LayerNorm', M, [x, gamma, beta], tmp_path)
+    x = mx.nd.random.uniform(1, 2, (3, 4, 5), dtype=dtype)

Review comment:
       I think dtype is not defined?




----------------------------------------------------------------
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:
users@infra.apache.org