Skip to content

Commit c85dce5

Browse files
Refactor type hints in median_absolute_error.py (#3498)
This PR refractors type hints in 'ignite/metrics/regression/median_absolute_error.py' to use Python 3.10+ syntax. Related to #3481
1 parent 44e4a50 commit c85dce5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ignite/metrics/regression/median_absolute_error.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Callable, Union
1+
from typing import Callable
22

33
import torch
44

@@ -64,9 +64,7 @@ class MedianAbsoluteError(EpochMetric):
6464
0.625
6565
"""
6666

67-
def __init__(
68-
self, output_transform: Callable = lambda x: x, device: Union[str, torch.device] = torch.device("cpu")
69-
):
67+
def __init__(self, output_transform: Callable = lambda x: x, device: str | torch.device = torch.device("cpu")):
7068
super(MedianAbsoluteError, self).__init__(
7169
median_absolute_error_compute_fn, output_transform=output_transform, device=device
7270
)

0 commit comments

Comments
 (0)