Use torch.randperm to get row-wise column permutations: >>> perm = torch.stack([torch.randperm(10) for _ in range(len(x))]) tensor([[8, 0, 3, 2, 1, 6, 9, 4, ...
確定! 回上一頁