From 7e769e0ff7458d5bd5281f5688ee175eee7b9869 Mon Sep 17 00:00:00 2001 From: Mikhail Moskovchenko Date: Wed, 28 May 2025 02:00:47 +0400 Subject: [PATCH] Explicitly set reduction --- segmentation_models_pytorch/losses/focal.py | 1 + 1 file changed, 1 insertion(+) diff --git a/segmentation_models_pytorch/losses/focal.py b/segmentation_models_pytorch/losses/focal.py index 0e055162..d26acb52 100644 --- a/segmentation_models_pytorch/losses/focal.py +++ b/segmentation_models_pytorch/losses/focal.py @@ -45,6 +45,7 @@ def __init__( self.mode = mode self.ignore_index = ignore_index + self.reduction = reduction self.focal_loss_fn = partial( focal_loss_with_logits, alpha=alpha,