mars.tensor.rollaxis#
- mars.tensor.rollaxis(tensor, axis, start=0)[源代码]#
Roll the specified axis backwards, until it lies in a given position.
This function continues to be supported for backward compatibility, but you should prefer moveaxis.
- 参数
- 返回
res – a view of a is always returned.
- 返回类型
Tensor
参见
实际案例
>>> import mars.tensor as mt
>>> a = mt.ones((3,4,5,6)) >>> mt.rollaxis(a, 3, 1).shape (3, 6, 4, 5) >>> mt.rollaxis(a, 2).shape (5, 3, 4, 6) >>> mt.rollaxis(a, 1, 4).shape (3, 5, 6, 4)