summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2021-02-14 20:50:34 +0800
committerJordan Gong <jordan.gong@protonmail.com>2021-02-14 20:50:34 +0800
commit10944fda51563b66cf441747f7a1b292236096cf (patch)
tree88c7ac4d1e23d39b6f19c79b701c628a3e304361 /utils
parent156fb6d957efda8b897c172d70eccc0d2016b2bf (diff)
parent34d2f9017e77a7bdef761ab3d92cd0340c5154c3 (diff)
Merge branch 'python3.8' into python3.7
Diffstat (limited to 'utils')
-rw-r--r--utils/triplet_loss.py2
1 files changed, 0 insertions, 2 deletions
diff --git a/utils/triplet_loss.py b/utils/triplet_loss.py
index d573ef4..954def2 100644
--- a/utils/triplet_loss.py
+++ b/utils/triplet_loss.py
@@ -9,9 +9,7 @@ class BatchAllTripletLoss(nn.Module):
self.margin = margin
def forward(self, x, y):
- # Duplicate labels for each part
p, n, c = x.size()
- y = y.repeat(p, 1)
# Euclidean distance p x n x n
x_squared_sum = torch.sum(x ** 2, dim=2)