Skip to content

Commit

Permalink
removed redundant line in dice loss
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaenzig committed Nov 20, 2024
1 parent 50c90a3 commit ec12e40
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 ec12e40

Please sign in to comment.