maxframe.tensor.rollaxis#
- maxframe.tensor.rollaxis(tensor, axis, start=0)[源代码]#
将指定轴向后滚动,直到它位于给定位置。
此函数为了向后兼容仍然支持,但建议使用 moveaxis。
- 参数:
- 返回:
res -- 总是返回 a 的视图。
- 返回类型:
Tensor
示例
>>> import maxframe.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)