Skip to content

Commit d416b2c

Browse files
authored
Fix handle_legacy_interface when passing strings (#5063)
1 parent 65438e9 commit d416b2c

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)