summaryrefslogtreecommitdiff
path: root/utils/triplet_loss.py
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2021-02-14 20:50:10 +0800
committerJordan Gong <jordan.gong@protonmail.com>2021-02-14 20:50:10 +0800
commit34d2f9017e77a7bdef761ab3d92cd0340c5154c3 (patch)
tree1cd208e9bfdc92900ee407653c3a21304e2e922d /utils/triplet_loss.py
parentba705ac60f463b034782ba03796dbfa2776a5631 (diff)
parentbe508061aeb3049a547c4e0c92d21c254689c1d5 (diff)
Merge branch 'master' into python3.8
Diffstat (limited to 'utils/triplet_loss.py')
-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)