diff options
author | Jordan Gong <jordan.gong@protonmail.com> | 2021-02-14 16:46:56 +0800 |
---|---|---|
committer | Jordan Gong <jordan.gong@protonmail.com> | 2021-02-14 16:46:56 +0800 |
commit | 929c48093c9f49a515420eb28d2678e48756b300 (patch) | |
tree | 9ec187d721c97a588f0207efe1311ceeee827d96 /utils | |
parent | ec7d85a066592bfbed2f6c4c56f9f0b6269897e3 (diff) |
Prepare for DataParallel
Diffstat (limited to 'utils')
-rw-r--r-- | utils/triplet_loss.py | 2 |
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) |