Solved by alexus37 in post #3 
              
              
                Thanks for the feedback. I understood the docs, but I wanted to use the cross product in 2D. 
Finally, I ended up doing this, if someone is having the same issue. 
 # pad the last dim to have 3D vector 
s_pad = F.pad(s, (0, 1))
# compute the cross product 
A = torch.cross(s_pad[:, index_list], s_pad…