From ca7900788a3075cbe26fc31c6eea259b3dfaa838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20P=C3=A9rez-Garc=C3=ADa?= Date: Thu, 30 Jan 2025 22:26:10 +0000 Subject: [PATCH] Fix mypy error (#1264) --- src/torchio/data/inference/aggregator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/torchio/data/inference/aggregator.py b/src/torchio/data/inference/aggregator.py index 445429b3..8f0c3211 100644 --- a/src/torchio/data/inference/aggregator.py +++ b/src/torchio/data/inference/aggregator.py @@ -104,7 +104,7 @@ def _initialize_avgmask_tensor(self, batch: torch.Tensor) -> None: ) @staticmethod - def _get_hann_window(patch_size): + def _get_hann_window(patch_size) -> torch.Tensor: hann_window_3d = torch.as_tensor([1]) # create a n-dim hann window for spatial_dim, size in enumerate(patch_size): @@ -211,6 +211,7 @@ def add_batch( j_ini:j_fin, k_ini:k_fin, ] += patch + assert self._hann_window is not None self._avgmask_tensor[ :, i_ini:i_fin,