Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Warvito committed Mar 29, 2023
1 parent e3545ae commit 1b8ed97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions monai/losses/ssim_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def __init__(
spatial_dims: int,
data_range: float = 1.0,
kernel_type: KernelType | str = KernelType.GAUSSIAN,
kernel_size: int | Sequence[int, ...] = 11,
kernel_sigma: float | Sequence[float, ...] = 1.5,
kernel_size: int | Sequence[int] = 11,
kernel_sigma: float | Sequence[float] = 1.5,
k1: float = 0.01,
k2: float = 0.03,
reduction: LossReduction | str = LossReduction.MEAN,
Expand Down
10 changes: 5 additions & 5 deletions monai/metrics/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ def __init__(
spatial_dims: int,
data_range: float = 1.0,
kernel_type: KernelType | str = KernelType.GAUSSIAN,
kernel_size: int | Sequence[int, ...] = 11,
kernel_sigma: float | Sequence[float, ...] = 1.5,
kernel_size: int | Sequence[int] = 11,
kernel_sigma: float | Sequence[float] = 1.5,
k1: float = 0.01,
k2: float = 0.03,
reduction: MetricReduction | str = MetricReduction.MEAN,
Expand Down Expand Up @@ -339,7 +339,7 @@ def _compute_metric(self, y_pred: torch.Tensor, y: torch.Tensor) -> torch.Tensor


def _gaussian_kernel(
spatial_dims: int, num_channels: int, kernel_size: Sequence[int, ...], kernel_sigma: Sequence[float, ...]
spatial_dims: int, num_channels: int, kernel_size: Sequence[int], kernel_sigma: Sequence[float]
) -> torch.Tensor:
"""Computes 2D or 3D gaussian kernel.
Expand Down Expand Up @@ -384,8 +384,8 @@ def compute_ssim_and_cs(
spatial_dims: int,
data_range: float = 1.0,
kernel_type: KernelType | str = KernelType.GAUSSIAN,
kernel_size: Sequence[int, ...] = 11,
kernel_sigma: Sequence[float, ...] = 1.5,
kernel_size: Sequence[int] = 11,
kernel_sigma: Sequence[float] = 1.5,
k1: float = 0.01,
k2: float = 0.03,
) -> tuple[torch.Tensor, torch.Tensor]:
Expand Down

0 comments on commit 1b8ed97

Please sign in to comment.