Skip to content

Commit 8369f4d

Browse files
committed
Update syntax of optional types in fn signatures
1 parent ac049db commit 8369f4d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/compressed_tensors/utils/match.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838

3939
def match_named_modules(
4040
model: torch.nn.Module,
41-
targets: Iterable[str] | None,
42-
ignore: Iterable[str] | None = None,
41+
targets: Optional[Iterable[str]] = None,
42+
ignore: Optional[Iterable[str]] = None,
4343
fused: Optional[FusedMappping] = None,
4444
warn_on_fail: bool = False,
4545
) -> Generator[Tuple[str, torch.nn.Module]]:
@@ -77,8 +77,8 @@ def match_named_modules(
7777

7878
def match_named_parameters(
7979
model: torch.nn.Module,
80-
targets: Iterable[str] | None = None,
81-
ignore: Iterable[str] | None = None,
80+
targets: Optional[Iterable[str]] = None,
81+
ignore: Optional[Iterable[str]] = None,
8282
fused: Optional[FusedMappping] = None,
8383
warn_on_fail: bool = False,
8484
) -> Generator[Tuple[str, torch.nn.Module, torch.nn.Parameter]]:
@@ -158,8 +158,8 @@ def match_targets(
158158

159159
def match_modules_set(
160160
model: torch.nn.Module,
161-
targets: Iterable[str] | None = None,
162-
ignore: Iterable[str] | None = None,
161+
targets: Optional[Iterable[str]] = None,
162+
ignore: Optional[Iterable[str]] = None,
163163
) -> Generator[Iterable[torch.nn.Module]]:
164164
"""
165165
Yields modules grouped with the same order and size as `targets`.

0 commit comments

Comments
 (0)