Skip to content

Commit

Permalink
removed redundant line in dice loss (#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaenzig authored Dec 6, 2024
1 parent 4b09f96 commit 9f73e79
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/eva/vision/losses/dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ def forward(self, inputs: torch.Tensor, targets: torch.Tensor) -> torch.Tensor:
inputs, targets = _apply_ignore_index(inputs, targets, self.ignore_index)
targets = _to_one_hot(targets, num_classes=inputs.shape[1])

if targets.ndim == 3:
targets = one_hot(targets[:, None, ...], num_classes=inputs.shape[1])

return super().forward(inputs, targets)


Expand Down

0 comments on commit 9f73e79

Please sign in to comment.