summaryrefslogtreecommitdiff
path: root/models/rgb_part_net.py
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2021-01-21 23:44:34 +0800
committerJordan Gong <jordan.gong@protonmail.com>2021-01-21 23:44:34 +0800
commit0b76205ecef02dd62ef2fbc8e12d9389b7cf7868 (patch)
tree71927f5efe2dc3228f49326a89e2536785aa2eb4 /models/rgb_part_net.py
parent8572f5c8292e5798912ad54764c9d3a99afb49ec (diff)
parent04c9d3210ff659bbe00dedb2d193a748e7a97b54 (diff)
Merge branch 'master' into python3.8
# Conflicts: # utils/configuration.py
Diffstat (limited to 'models/rgb_part_net.py')
-rw-r--r--models/rgb_part_net.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/models/rgb_part_net.py b/models/rgb_part_net.py
index 95a3f2e..326ec81 100644
--- a/models/rgb_part_net.py
+++ b/models/rgb_part_net.py
@@ -81,9 +81,8 @@ class RGBPartNet(nn.Module):
if self.training:
batch_all_triplet_loss = self.ba_triplet_loss(x, y)
- losses = (*losses, batch_all_triplet_loss)
- loss = torch.sum(torch.stack(losses))
- return loss, [loss.item() for loss in losses]
+ losses = torch.stack((*losses, batch_all_triplet_loss))
+ return losses
else:
return x.unsqueeze(1).view(-1)