mindspore.ops.moveaxis

View Source On Gitee
mindspore.ops.moveaxis(x, source, destination)[source]

Alias for ops.movedim. Moves axis of an array from source to destination.

Refer to mindspore.ops.movedim() for more detail.

Supported Platforms:

Ascend GPU CPU

Examples

>>> from mindspore import ops, Tensor
>>> import numpy as np
>>> x = Tensor(np.zeros((3, 4, 5)))
>>> output = ops.moveaxis(x, 0, -1)
>>> print(output.shape)
(4, 5, 3)