szha commented on issue #18695: URL: https://github.com/apache/incubator-mxnet/issues/18695#issuecomment-657255680
Two changes will help immediately: - Collapse consecutive axes of the input array into a single axis here https://github.com/apache/incubator-mxnet/blob/master/src/operator/numpy/np_matrix_op-inl.h#L142-L149 - Extend the implementation to support more https://github.com/apache/incubator-mxnet/blob/master/src/operator/tensor/matrix_op-inl.h#L362-L419 The root cause is really the limitation of template based programming in mshadow. Because of that choice, the axis is in template variable and thus needs to be expanded at compile time. We should move away from this approach and have a transpose implementation without mshadow instead. Let's focus on only the immediate changes, and I will open a separate issue for the larger change. ---------------------------------------------------------------- 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: us...@infra.apache.org