No, I don’t think so. What we have here is numpy / scipy cdist (so the two sets of points do not have to be the same ones, i.e. do not need to be of an equal number) whereas torch pairwise_distance does require that.
It fails for something like (First dimension is batch size, N, D)
x = torch.zeros((3, 5, 2))
y = torch.zeros((3, 2, 2))

x[0, 0, 0] = 1
torch.pairwise_distance(x, y, p=2)

However, you may vote: https://github.com/pytorch/pytorch/issues/15253 236