fusheng_hao:

dist = torch.pow(x - y, 2).sum(2)


This answer is MEGA AESTHETIC.
thanks!!
also shout out to @AtheMathmo for posing the similar problem I had in terms that helped me understand my own situation