You can use torch.randperm . For tensor t , you can use: t[:,torch.randperm(t.shape[1]),:] For your example: >>> t = torch.tensor([[[1,1],[2 ...
確定! 回上一頁