RafLit commented on pull request #20419: URL: https://github.com/apache/incubator-mxnet/pull/20419#issuecomment-889935824
I changed the nd.transpose api, so that "axes=None" instead of "axes=[]" would run the default reversal of axes (like for numpy api): master: ``` x = mx.nd.arange(24, ctx=mx.cpu()).reshape(2,3,4) y = mx.nd.transpose(x, axes=[]) # works fine y = mx.nd.transpose(x, axes=None) MXNetError: Check failed: std: :max(shp.ndim(), out_shp.ndim()) == param.axes.ndim() (3 vs. -1) : ``` this PR: ``` y = mx.nd.transpose(x, axes=[]) MXNetError: Check failed: std: :max(shape.ndim(), out_shape.ndim()) == param.axes.ndim() (3 vs. 0) : The number of axes does not match the dimension of the tensor. y = mx.nd.transpose(x, axes=None) # works fine ``` I think this solution is more intuitive and clear. @szha Is this change to the api fine? -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
