MCPcopy Create free account
hub / github.com/Zhiyuan-R/Tiger-Diffusion / pairwise_dist

Function pairwise_dist

metrics/ChamferDistancePytorch/chamfer_python.py:4–9  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

2
3
4def pairwise_dist(x, y):
5 xx, yy, zz = torch.mm(x, x.t()), torch.mm(y, y.t()), torch.mm(x, y.t())
6 rx = xx.diag().unsqueeze(0).expand_as(xx)
7 ry = yy.diag().unsqueeze(0).expand_as(yy)
8 P = rx.t() + ry - 2 * zz
9 return P
10
11
12def NN_loss(x, y, dim=0):

Callers 1

NN_lossFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected