Skip to content

Commit 6aaa2b0

Browse files
authored
Change weights return type to Mapping (#6097)
1 parent 952f480 commit 6aaa2b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/models/_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44
from dataclasses import dataclass, fields
55
from inspect import signature
6-
from typing import Any, Callable, Dict, cast
6+
from typing import Any, Callable, Dict, Mapping, cast
77

88
from torchvision._utils import StrEnum
99

@@ -59,7 +59,7 @@ def verify(cls, obj: Any) -> Any:
5959
)
6060
return obj
6161

62-
def get_state_dict(self, progress: bool) -> Dict[str, Any]:
62+
def get_state_dict(self, progress: bool) -> Mapping[str, Any]:
6363
return load_state_dict_from_url(self.url, progress=progress)
6464

6565
def __repr__(self) -> str:

0 commit comments

Comments
 (0)