Skip to content

Commit d16d5b0

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] Fix handle_legacy_interface when passing strings (#5063)
Reviewed By: fmassa Differential Revision: D33185007 fbshipit-source-id: c69cdae11f6925462b181858f652e5bd29c083fb
1 parent c780be5 commit d16d5b0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

torchvision/prototype/models/_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def inner_wrapper(*args: Any, **kwargs: Any) -> M:
4343
if (
4444
(weights_param not in kwargs and pretrained_param not in kwargs)
4545
or isinstance(weights_arg, WeightsEnum)
46+
or (isinstance(weights_arg, str) and weights_arg != "legacy")
4647
or weights_arg is None
4748
):
4849
continue

0 commit comments

Comments
 (0)