MCPcopy
hub / github.com/pytorch/vision / verify

Method verify

torchvision/models/_api.py:80–88  ·  view source on GitHub ↗
(cls, obj: Any)

Source from the content-addressed store, hash-verified

78
79 @classmethod
80 def verify(cls, obj: Any) -> Any:
81 if obj is not None:
82 if type(obj) is str:
83 obj = cls[obj.replace(cls.__name__ + ".", "")]
84 elif not isinstance(obj, cls):
85 raise TypeError(
86 f"Invalid Weight class provided; expected {cls.__name__} but received {obj.__class__.__name__}."
87 )
88 return obj
89
90 def get_state_dict(self, *args: Any, **kwargs: Any) -> dict[str, Any]:
91 return load_state_dict_from_url(self.url, *args, **kwargs)

Callers 15

densenet121Function · 0.80
densenet161Function · 0.80
densenet169Function · 0.80
densenet201Function · 0.80
mobilenet_v3_largeFunction · 0.80
mobilenet_v3_smallFunction · 0.80
convnext_tinyFunction · 0.80
convnext_smallFunction · 0.80
convnext_baseFunction · 0.80
convnext_largeFunction · 0.80
alexnetFunction · 0.80
squeezenet1_0Function · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected