Skip to content

Commit 7e8c482

Browse files
committed
Renaming var and making named params mandatory.
1 parent 49c4433 commit 7e8c482

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

torchvision/models/convnext.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
]
2121

2222

23-
model_urls: Dict[str, Optional[str]] = {
23+
_MODELS_URLS: Dict[str, Optional[str]] = {
2424
"convnext_tiny": "https://download.pytorch.org/models/convnext_tiny-983f1562.pth",
2525
"convnext_small": "https://download.pytorch.org/models/convnext_small-0c510722.pth",
2626
"convnext_base": "https://download.pytorch.org/models/convnext_base-6075fbad.pth",
@@ -196,14 +196,14 @@ def _convnext(
196196
) -> ConvNeXt:
197197
model = ConvNeXt(block_setting, stochastic_depth_prob=stochastic_depth_prob, **kwargs)
198198
if pretrained:
199-
if arch not in model_urls:
199+
if arch not in _MODELS_URLS:
200200
raise ValueError(f"No checkpoint is available for model type {arch}")
201-
state_dict = load_state_dict_from_url(model_urls[arch], progress=progress)
201+
state_dict = load_state_dict_from_url(_MODELS_URLS[arch], progress=progress)
202202
model.load_state_dict(state_dict)
203203
return model
204204

205205

206-
def convnext_tiny(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ConvNeXt:
206+
def convnext_tiny(*, pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ConvNeXt:
207207
r"""ConvNeXt Tiny model architecture from the
208208
`"A ConvNet for the 2020s" <https://arxiv.org/abs/2201.03545>`_ paper.
209209
Args:
@@ -220,7 +220,7 @@ def convnext_tiny(pretrained: bool = False, progress: bool = True, **kwargs: Any
220220
return _convnext("convnext_tiny", block_setting, stochastic_depth_prob, pretrained, progress, **kwargs)
221221

222222

223-
def convnext_small(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ConvNeXt:
223+
def convnext_small(*, pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ConvNeXt:
224224
r"""ConvNeXt Small model architecture from the
225225
`"A ConvNet for the 2020s" <https://arxiv.org/abs/2201.03545>`_ paper.
226226
Args:
@@ -237,7 +237,7 @@ def convnext_small(pretrained: bool = False, progress: bool = True, **kwargs: An
237237
return _convnext("convnext_small", block_setting, stochastic_depth_prob, pretrained, progress, **kwargs)
238238

239239

240-
def convnext_base(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ConvNeXt:
240+
def convnext_base(*, pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ConvNeXt:
241241
r"""ConvNeXt Base model architecture from the
242242
`"A ConvNet for the 2020s" <https://arxiv.org/abs/2201.03545>`_ paper.
243243
Args:
@@ -254,7 +254,7 @@ def convnext_base(pretrained: bool = False, progress: bool = True, **kwargs: Any
254254
return _convnext("convnext_base", block_setting, stochastic_depth_prob, pretrained, progress, **kwargs)
255255

256256

257-
def convnext_large(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ConvNeXt:
257+
def convnext_large(*, pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ConvNeXt:
258258
r"""ConvNeXt Large model architecture from the
259259
`"A ConvNet for the 2020s" <https://arxiv.org/abs/2201.03545>`_ paper.
260260
Args:

0 commit comments

Comments
 (0)