Pytorch | 接口[1]

torch.Tensor().flip()

torch.Tensor().flip(dim)

作用

  指定dim反转张量

示例

a = torch.Tensor([1,0])
print(a.flip(0))

>>> tensor([0., 1.])
posted @ 2019-06-04 17:43  Zachary'  阅读(386)  评论(0编辑  收藏  举报