diff options
author | Jordan Gong <jordan.gong@protonmail.com> | 2021-01-21 23:47:52 +0800 |
---|---|---|
committer | Jordan Gong <jordan.gong@protonmail.com> | 2021-01-21 23:47:52 +0800 |
commit | c0c8299354bd41bfd668ff0fb3edb5997f590c5d (patch) | |
tree | 25502d76a218a71ad5c2d51001876b08d734ee47 /models/rgb_part_net.py | |
parent | 42847b721a99350e1eed423dce99574c584d97ef (diff) | |
parent | d750dd9dafe3cda3b1331ad2bfecb53c8c2b1267 (diff) |
Merge branch 'python3.8' into python3.7
# Conflicts:
# utils/configuration.py
Diffstat (limited to 'models/rgb_part_net.py')
-rw-r--r-- | models/rgb_part_net.py | 5 |
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) |