You can also use torch.tolist()
>>> a = torch.zeros([2,4]) >>> a tensor([[0., 0., 0., 0.], [0., 0., 0., 0.]]) >>> a = a.tolist() [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]
And index from there