Skip to content

Commit 0e79579

Browse files
committed
Fix newer type annotation in layers/typing
1 parent e6ab6bc commit 0e79579

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

timm/layers/typing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from contextlib import nullcontext
22
from functools import wraps
3-
from typing import Callable, Tuple, Type, TypeVar, Union, overload, ContextManager
3+
from typing import Callable, Optional, Tuple, Type, TypeVar, Union, overload, ContextManager
44

55
import torch
66

@@ -19,7 +19,7 @@ def nullwrap(fn: F) -> F: ... # decorator form
1919
@overload
2020
def nullwrap(fn: None = ...) -> ContextManager: ... # context‑manager form
2121

22-
def nullwrap(fn: F | None = None):
22+
def nullwrap(fn: Optional[F] = None):
2323
# as a context manager
2424
if fn is None:
2525
return nullcontext() # `with nullwrap():`

0 commit comments

Comments
 (0)