Skip to content

Commit

Permalink
Minor refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
datumbox committed Oct 13, 2021
1 parent d849481 commit 104a05c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions torchvision/prototype/models/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ class WeightEntry:
transforms: Callable
meta: Dict[str, Any]

def state_dict(self, progress: bool) -> Dict[str, Any]:
return load_state_dict_from_url(self.url, progress=progress)


class Weights(Enum):
"""
Expand Down Expand Up @@ -66,7 +63,7 @@ def from_str(cls, value: str) -> "Weights":
raise ValueError(f"Invalid value {value} for enum {cls.__name__}.")

def state_dict(self, progress: bool) -> OrderedDict:
return self.value.state_dict(progress)
return load_state_dict_from_url(self.url, progress=progress)

def __repr__(self):
return f"{self.__class__.__name__}.{self._name_}"
Expand Down

0 comments on commit 104a05c

Please sign in to comment.