Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

moveaxis doesn't support negative indices #13563

Closed
asmeurer opened this issue Dec 6, 2018 · 5 comments
Closed

moveaxis doesn't support negative indices #13563

asmeurer opened this issue Dec 6, 2018 · 5 comments

Comments

@asmeurer
Copy link

asmeurer commented Dec 6, 2018

The moveaxis method doesn't support negative indices. Something like

if source < 0: source = axes[source]
if target < 0: target = axes[target]

should fix it. It also doesn't support lists of indices like NumPy.

@lanking520
Copy link
Member

Hi @asmeurer thanks for your issue,
asked someone to take a look here: @apeforest @samskalicky

@apeforest
Copy link
Contributor

@mxnet-label-bot Add [Operator]

@ifeherva
Copy link
Contributor

ifeherva commented Mar 4, 2019

I have an implementation already just need to ask tests and will PR.

@ifeherva
Copy link
Contributor

ifeherva commented Mar 4, 2019

See PR here
#14321

@haojin2
Copy link
Contributor

haojin2 commented Nov 19, 2019

Closing the issue since it's been fixed, also in the new mxnet.np module:

>>> from mxnet import np
>>> x = np.zeros((3, 4, 5))
>>> np.moveaxis(x, [0, 1], [-1, -2]).shape
(5, 4, 3)

@haojin2 haojin2 closed this as completed Nov 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants