Skip to content

Commit

Permalink
refactor affinity loss to ensure all execution branches are available
Browse files Browse the repository at this point in the history
  • Loading branch information
RMeli committed Dec 2, 2021
1 parent 269ed36 commit d34c1e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gnina/losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def forward(self, input: Tensor, target: Tensor) -> Tensor:

if self.reduction == "mean":
reduced_loss = torch.mean(loss)
elif self.reduction == "sum":
else: # Assertion in init ensures that reduction is "sum"
reduced_loss = torch.sum(loss)

return self.scale * reduced_loss

0 comments on commit d34c1e6

Please sign in to comment.