Shuffling a Tensor

@asml , @ptrbick - thanks both. is something like this

t=torch.tensor([[1,2],[3,4]])
r=torch.randperm(2)
c=torch.randperm(2)
t=t[r][:,c]

The most elegant solution? Its simple enough but the indexing in t[r][:,c] feels a bit odd

10 Likes