diff --git a/torchvision/models/_api.py b/torchvision/models/_api.py index 358e6f43159..5f46bcb5cd0 100644 --- a/torchvision/models/_api.py +++ b/torchvision/models/_api.py @@ -2,7 +2,7 @@ import importlib import inspect import sys -from collections.abc import Iterable, Mapping +from collections.abc import Iterable from dataclasses import dataclass from enum import Enum from functools import partial @@ -87,7 +87,7 @@ def verify(cls, obj: Any) -> Any: ) return obj - def get_state_dict(self, *args: Any, **kwargs: Any) -> Mapping[str, Any]: + def get_state_dict(self, *args: Any, **kwargs: Any) -> dict[str, Any]: return load_state_dict_from_url(self.url, *args, **kwargs) def __repr__(self) -> str: