<ipython-input-41-59f0a1e15b43> in forward(self, u, v)
     13         distances=cos(u,v)
     14         # by construction the diagonal contains the correct elements
---> 15         correct_elements = torch.diagonal(cos(u,v),0).unsqueeze(0)
     16         # number of elements ranked wrong.
     17         return torch.sum(distances < correct_elements)

IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)