I would like to figure out a way to apply a function which calculates pairwise distances, let\'s call it dists(A, B), row-wise for every input element in a batch, meaning: