Given:
- a tensor A has shape (batch_size, dim)
- a tensor B has shape (batch_size, N, dim)
I want to calculate euclidean distance between each row in A and the correspond row in B which has shape (N, dim)
The expected result has shape (batch_size, N)
Источник: https://stackoverflow.com/questions/780 ... in-pytorch