From 929c48093c9f49a515420eb28d2678e48756b300 Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Sun, 14 Feb 2021 16:46:56 +0800 Subject: Prepare for DataParallel --- utils/triplet_loss.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'utils/triplet_loss.py') 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) -- cgit v1.2.3