Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
add description for backbones
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushikb11 committed Feb 3, 2021
1 parent 7f73823 commit 65e8794
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion flash/vision/backbones.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@


def torchvision_backbone_and_num_features(model_name: str, pretrained: bool = True) -> Tuple[nn.Module, int]:

"""
>>> torchvision_backbone_and_num_features('mobilenet_v2') # doctest: +ELLIPSIS
(Sequential(...), 1280)
>>> torchvision_backbone_and_num_features('resnet18') # doctest: +ELLIPSIS
(Sequential(...), 512)
>>> torchvision_backbone_and_num_features('densenet121') # doctest: +ELLIPSIS
(Sequential(...), 1024)
"""
model = getattr(torchvision.models, model_name, None)
if model is None:
raise MisconfigurationException(f"{model_name} is not supported by torchvision")
Expand Down

0 comments on commit 65e8794

Please sign in to comment.