diff --git a/monai/losses/dice.py b/monai/losses/dice.py index 4068098e2f..9fdba7f37b 100644 --- a/monai/losses/dice.py +++ b/monai/losses/dice.py @@ -738,10 +738,7 @@ def forward(self, input: torch.Tensor, target: torch.Tensor) -> torch.Tensor: f"got shape {input.shape} and {target.shape}." ) if input.shape[1] == 1: - raise ValueError( - "the number of channels for input should be larger than 1," - f"got shape {input.shape}." - ) + raise ValueError("the number of channels for input should be larger than 1," f"got shape {input.shape}.") dice_loss = self.dice(input, target) ce_loss = self.ce(input, target)