Solved by ptrblck in post #2 
              
              
                This error is raised, if the index tensor has a single dimension only while you are indexing it at dim1: 
boxes = torch.randn(4)
out = (boxes[:, 3] - boxes[:, 1]) * (boxes[:, 2] - boxes[:, 0])
> IndexError: too many indices for tensor of dimension 1

boxes = torch.randn(1, 4)
out = (boxes[:, 3] - bo…