模型开发接口
推理部署接口
API 相关说明
Interchange two axes of a tensor.
inp (Tensor) – input tensor to swapaxes.
Tensor
axis1 (int) – first axis.
int
axis2 (int) – second axis.
a tensor after swapping the two axes of ‘inp’.
实际案例
>>> x = Tensor(np.array([[[0,1],[2,3]],[[4,5],[6,7]]], dtype=np.int32)) >>> F.swapaxes(x, 0, 2) Tensor([[[0 4] [2 6]] [[1 5] [3 7]]], dtype=int32, device=xpux:0)
上一页
megengine.functional.transpose
下一页
megengine.functional.broadcast_to