Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
f670152b
".github/vscode:/vscode.git/clone" did not exist on "ba2ba9019f76fd96c532240ed07d3f98343e4041"
Unverified
Commit
f670152b
authored
Jan 20, 2022
by
Yoshitomo Matsubara
Committed by
GitHub
Jan 20, 2022
Browse files
check if value exists without iteration (#5225)
parent
03d11338
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
torchvision/prototype/models/_api.py
torchvision/prototype/models/_api.py
+2
-3
No files found.
torchvision/prototype/models/_api.py
View file @
f670152b
...
...
@@ -60,9 +60,8 @@ class WeightsEnum(Enum):
@
classmethod
def
from_str
(
cls
,
value
:
str
)
->
"WeightsEnum"
:
for
k
,
v
in
cls
.
__members__
.
items
():
if
k
==
value
:
return
v
if
value
in
cls
.
__members__
:
return
cls
.
__members__
[
value
]
raise
ValueError
(
f
"Invalid value
{
value
}
for enum
{
cls
.
__name__
}
."
)
def
get_state_dict
(
self
,
progress
:
bool
)
->
OrderedDict
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment