From 0f3042aa9abcdcbf8be51585e73831e06a109c05 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 29 Nov 2025 17:03:54 +0100 Subject: [PATCH] WeightsEnum.get_state_dict: fix return type Signed-off-by: Adam J. Stewart --- torchvision/models/_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: