id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18,400 | pytorch/vision | pytorch_vision/torchvision/models/regnet.py | torchvision.models.regnet.RegNet_Y_32GF_Weights | from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification, InterpolationMode
from functools import partial
class RegNet_Y_32GF_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/regnet_y_32gf-4dee3f7a.pth', transforms=partial(Im... |
class RegNet_Y_32GF_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 87 | 0 | 87 | 6 | 86 | 2 | 6 | 6 | 5 | 0 | 5 | 0 | 0 |
18,401 | pytorch/vision | pytorch_vision/torchvision/models/regnet.py | torchvision.models.regnet.RegNet_Y_3_2GF_Weights | from functools import partial
from ..transforms._presets import ImageClassification, InterpolationMode
from ._api import register_model, Weights, WeightsEnum
class RegNet_Y_3_2GF_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/regnet_y_3_2gf-b5a9779c.pth', transforms=partial(... |
class RegNet_Y_3_2GF_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 42 | 0 | 42 | 4 | 41 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,402 | pytorch/vision | pytorch_vision/torchvision/models/regnet.py | torchvision.models.regnet.RegNet_Y_400MF_Weights | from functools import partial
from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification, InterpolationMode
class RegNet_Y_400MF_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/regnet_y_400mf-c65dace8.pth', transforms=partial(... |
class RegNet_Y_400MF_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 42 | 0 | 42 | 4 | 41 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,403 | pytorch/vision | pytorch_vision/torchvision/models/regnet.py | torchvision.models.regnet.RegNet_Y_800MF_Weights | from ._api import register_model, Weights, WeightsEnum
from functools import partial
from ..transforms._presets import ImageClassification, InterpolationMode
class RegNet_Y_800MF_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/regnet_y_800mf-1b27b58c.pth', transforms=partial(... |
class RegNet_Y_800MF_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 42 | 0 | 42 | 4 | 41 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,404 | pytorch/vision | pytorch_vision/torchvision/models/regnet.py | torchvision.models.regnet.RegNet_Y_8GF_Weights | from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification, InterpolationMode
from functools import partial
class RegNet_Y_8GF_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/regnet_y_8gf-d0d0e4a8.pth', transforms=partial(Imag... |
class RegNet_Y_8GF_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 42 | 0 | 42 | 4 | 41 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,405 | pytorch/vision | pytorch_vision/torchvision/models/regnet.py | torchvision.models.regnet.ResBottleneckBlock | from ..ops.misc import Conv2dNormActivation, SqueezeExcitation
from typing import Any, Callable, Optional
from torch import nn, Tensor
class ResBottleneckBlock(nn.Module):
"""Residual bottleneck block: x + F(x), F = bottleneck transform."""
def __init__(self, width_in: int, width_out: int, stride: int, norm_l... |
class ResBottleneckBlock(nn.Module):
'''Residual bottleneck block: x + F(x), F = bottleneck transform.'''
def __init__(self, width_in: int, width_out: int, stride: int, norm_layer: Callable[..., nn.Module], activation_layer: Callable[..., nn.Module], group_width: int=1, bottleneck_multiplier: float=1.0, se_ra... | 3 | 1 | 19 | 1 | 18 | 1 | 2 | 0.06 | 1 | 6 | 2 | 0 | 2 | 3 | 2 | 12 | 41 | 3 | 36 | 17 | 23 | 2 | 14 | 7 | 11 | 2 | 1 | 1 | 4 |
18,406 | pytorch/vision | pytorch_vision/torchvision/models/regnet.py | torchvision.models.regnet.SimpleStemIN | from ..ops.misc import Conv2dNormActivation, SqueezeExcitation
from typing import Any, Callable, Optional
from torch import nn, Tensor
class SimpleStemIN(Conv2dNormActivation):
"""Simple stem for ImageNet: 3x3, BN, ReLU."""
def __init__(self, width_in: int, width_out: int, norm_layer: Callable[..., nn.Module]... |
class SimpleStemIN(Conv2dNormActivation):
'''Simple stem for ImageNet: 3x3, BN, ReLU.'''
def __init__(self, width_in: int, width_out: int, norm_layer: Callable[..., nn.Module], activation_layer: Callable[..., nn.Module]) -> None:
pass | 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.09 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 3 | 13 | 1 | 11 | 8 | 3 | 1 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
18,407 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.BasicBlock | import torch.nn as nn
from typing import Any, Callable, Optional, Union
from torch import Tensor
class BasicBlock(nn.Module):
expansion: int = 1
def __init__(self, inplanes: int, planes: int, stride: int=1, downsample: Optional[nn.Module]=None, groups: int=1, base_width: int=64, dilation: int=1, norm_layer: O... |
class BasicBlock(nn.Module):
def __init__(self, inplanes: int, planes: int, stride: int=1, downsample: Optional[nn.Module]=None, groups: int=1, base_width: int=64, dilation: int=1, norm_layer: Optional[Callable[..., nn.Module]]=None) -> None:
pass
def forward(self, x: Tensor) -> Tensor:
pass | 3 | 0 | 22 | 3 | 19 | 1 | 3 | 0.03 | 1 | 5 | 0 | 1 | 2 | 7 | 2 | 12 | 47 | 7 | 39 | 23 | 26 | 1 | 29 | 13 | 26 | 4 | 1 | 1 | 6 |
18,408 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.Bottleneck | from torch import Tensor
from typing import Any, Callable, Optional, Union
import torch.nn as nn
class Bottleneck(nn.Module):
expansion: int = 4
def __init__(self, inplanes: int, planes: int, stride: int=1, downsample: Optional[nn.Module]=None, groups: int=1, base_width: int=64, dilation: int=1, norm_layer: O... |
class Bottleneck(nn.Module):
def __init__(self, inplanes: int, planes: int, stride: int=1, downsample: Optional[nn.Module]=None, groups: int=1, base_width: int=64, dilation: int=1, norm_layer: Optional[Callable[..., nn.Module]]=None) -> None:
pass
def forward(self, x: Tensor) -> Tensor:
pass | 3 | 0 | 23 | 3 | 20 | 1 | 2 | 0.15 | 1 | 3 | 0 | 1 | 2 | 9 | 2 | 12 | 56 | 9 | 41 | 26 | 28 | 6 | 31 | 16 | 28 | 2 | 1 | 1 | 4 |
18,409 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.ResNeXt101_32X8D_Weights | from functools import partial
from ..transforms._presets import ImageClassification
from ._api import register_model, Weights, WeightsEnum
class ResNeXt101_32X8D_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/resnext101_32x8d-8ba56ff5.pth', transforms=partial(ImageClassifica... |
class ResNeXt101_32X8D_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 41 | 0 | 41 | 4 | 40 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,410 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.ResNeXt101_64X4D_Weights | from ..transforms._presets import ImageClassification
from ._api import register_model, Weights, WeightsEnum
from functools import partial
class ResNeXt101_64X4D_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/resnext101_64x4d-173b62eb.pth', transforms=partial(ImageClassifica... |
class ResNeXt101_64X4D_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 23 | 0 | 23 | 3 | 22 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,411 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.ResNeXt50_32X4D_Weights | from functools import partial
from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification
class ResNeXt50_32X4D_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/resnext50_32x4d-7cdf4587.pth', transforms=partial(ImageClassificati... |
class ResNeXt50_32X4D_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 41 | 0 | 41 | 4 | 40 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,412 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.ResNet | from torch import Tensor
from typing import Any, Callable, Optional, Union
import torch
import torch.nn as nn
from ..utils import _log_api_usage_once
class ResNet(nn.Module):
def __init__(self, block: type[Union[BasicBlock, Bottleneck]], layers: list[int], num_classes: int=1000, zero_init_residual: bool=False, gr... |
class ResNet(nn.Module):
def __init__(self, block: type[Union[BasicBlock, Bottleneck]], layers: list[int], num_classes: int=1000, zero_init_residual: bool=False, groups: int=1, width_per_group: int=64, replace_stride_with_dilation: Optional[list[bool]]=None, norm_layer: Optional[Callable[..., nn.Module]]=None) ->... | 5 | 0 | 29 | 2 | 26 | 2 | 4 | 0.08 | 1 | 8 | 2 | 1 | 4 | 15 | 4 | 14 | 120 | 11 | 103 | 43 | 81 | 8 | 65 | 26 | 60 | 11 | 1 | 3 | 17 |
18,413 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.ResNet101_Weights | from ..transforms._presets import ImageClassification
from ._api import register_model, Weights, WeightsEnum
from functools import partial
class ResNet101_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/resnet101-63fe2227.pth', transforms=partial(ImageClassification, crop_siz... |
class ResNet101_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 41 | 0 | 41 | 4 | 40 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,414 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.ResNet152_Weights | from ..transforms._presets import ImageClassification
from functools import partial
from ._api import register_model, Weights, WeightsEnum
class ResNet152_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/resnet152-394f9c45.pth', transforms=partial(ImageClassification, crop_siz... |
class ResNet152_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 41 | 0 | 41 | 4 | 40 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,415 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.ResNet18_Weights | from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification
from functools import partial
class ResNet18_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/resnet18-f37072fd.pth', transforms=partial(ImageClassification, crop_size=... |
class ResNet18_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 20 | 0 | 20 | 3 | 19 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,416 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.ResNet34_Weights | from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification
from functools import partial
class ResNet34_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/resnet34-b627a593.pth', transforms=partial(ImageClassification, crop_size=... |
class ResNet34_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 20 | 0 | 20 | 3 | 19 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,417 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.ResNet50_Weights | from functools import partial
from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification
class ResNet50_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/resnet50-0676ba61.pth', transforms=partial(ImageClassification, crop_size=... |
class ResNet50_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 41 | 0 | 41 | 4 | 40 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,418 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.Wide_ResNet101_2_Weights | from ..transforms._presets import ImageClassification
from functools import partial
from ._api import register_model, Weights, WeightsEnum
class Wide_ResNet101_2_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/wide_resnet101_2-32ee1156.pth', transforms=partial(ImageClassifica... |
class Wide_ResNet101_2_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 41 | 0 | 41 | 4 | 40 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,419 | pytorch/vision | pytorch_vision/torchvision/models/resnet.py | torchvision.models.resnet.Wide_ResNet50_2_Weights | from ..transforms._presets import ImageClassification
from functools import partial
from ._api import register_model, Weights, WeightsEnum
class Wide_ResNet50_2_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/wide_resnet50_2-95faca4d.pth', transforms=partial(ImageClassificati... |
class Wide_ResNet50_2_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 41 | 0 | 41 | 4 | 40 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,420 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/_utils.py | torchvision.models.segmentation._utils._SimpleSegmentationModel | from torch.nn import functional as F
from typing import Optional
from torch import nn, Tensor
from collections import OrderedDict
from ...utils import _log_api_usage_once
class _SimpleSegmentationModel(nn.Module):
__constants__ = ['aux_classifier']
def __init__(self, backbone: nn.Module, classifier: nn.Module... |
class _SimpleSegmentationModel(nn.Module):
def __init__(self, backbone: nn.Module, classifier: nn.Module, aux_classifier: Optional[nn.Module]=None) -> None:
pass
def forward(self, x: Tensor) -> dict[str, Tensor]:
pass | 3 | 0 | 12 | 2 | 10 | 1 | 2 | 0.05 | 1 | 4 | 0 | 2 | 2 | 3 | 2 | 12 | 28 | 5 | 22 | 10 | 19 | 1 | 22 | 10 | 19 | 2 | 1 | 1 | 3 |
18,421 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/deeplabv3.py | torchvision.models.segmentation.deeplabv3.ASPP | from torch import nn
from collections.abc import Sequence
import torch
class ASPP(nn.Module):
def __init__(self, in_channels: int, atrous_rates: Sequence[int], out_channels: int=256) -> None:
super().__init__()
modules = []
modules.append(nn.Sequential(nn.Conv2d(in_channels, out_channels, ... |
class ASPP(nn.Module):
def __init__(self, in_channels: int, atrous_rates: Sequence[int], out_channels: int=256) -> None:
pass
def forward(self, x: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 14 | 2 | 12 | 0 | 2 | 0 | 1 | 6 | 2 | 0 | 2 | 2 | 2 | 12 | 29 | 5 | 24 | 11 | 21 | 0 | 17 | 11 | 14 | 2 | 1 | 1 | 4 |
18,422 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/deeplabv3.py | torchvision.models.segmentation.deeplabv3.ASPPConv | from torch import nn
class ASPPConv(nn.Sequential):
def __init__(self, in_channels: int, out_channels: int, dilation: int) -> None:
modules = [nn.Conv2d(in_channels, out_channels, 3, padding=dilation, dilation=dilation, bias=False), nn.BatchNorm2d(out_channels), nn.ReLU()]
super().__init__(*module... |
class ASPPConv(nn.Sequential):
def __init__(self, in_channels: int, out_channels: int, dilation: int) -> None:
pass | 2 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 1 | 8 | 0 | 8 | 3 | 6 | 0 | 4 | 3 | 2 | 1 | 1 | 0 | 1 |
18,423 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/deeplabv3.py | torchvision.models.segmentation.deeplabv3.ASPPPooling | from torch.nn import functional as F
import torch
from torch import nn
class ASPPPooling(nn.Sequential):
def __init__(self, in_channels: int, out_channels: int) -> None:
super().__init__(nn.AdaptiveAvgPool2d(1), nn.Conv2d(in_channels, out_channels, 1, bias=False), nn.BatchNorm2d(out_channels), nn.ReLU())
... |
class ASPPPooling(nn.Sequential):
def __init__(self, in_channels: int, out_channels: int) -> None:
pass
def forward(self, x: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 6 | 0 | 6 | 0 | 2 | 0 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 2 | 14 | 1 | 13 | 5 | 10 | 0 | 8 | 5 | 5 | 2 | 1 | 1 | 3 |
18,424 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/deeplabv3.py | torchvision.models.segmentation.deeplabv3.DeepLabHead | from torch import nn
from collections.abc import Sequence
class DeepLabHead(nn.Sequential):
def __init__(self, in_channels: int, num_classes: int, atrous_rates: Sequence[int]=(12, 24, 36)) -> None:
super().__init__(ASPP(in_channels, atrous_rates), nn.Conv2d(256, 256, 3, padding=1, bias=False), nn.BatchNor... |
class DeepLabHead(nn.Sequential):
def __init__(self, in_channels: int, num_classes: int, atrous_rates: Sequence[int]=(12, 24, 36)) -> None:
pass | 2 | 0 | 8 | 0 | 8 | 0 | 1 | 0 | 1 | 3 | 1 | 0 | 1 | 0 | 1 | 1 | 9 | 0 | 9 | 2 | 7 | 0 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
18,425 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/deeplabv3.py | torchvision.models.segmentation.deeplabv3.DeepLabV3 | from ._utils import _SimpleSegmentationModel
class DeepLabV3(_SimpleSegmentationModel):
"""
Implements DeepLabV3 model from
`"Rethinking Atrous Convolution for Semantic Image Segmentation"
<https://arxiv.org/abs/1706.05587>`_.
Args:
backbone (nn.Module): the network used to compute the fea... |
class DeepLabV3(_SimpleSegmentationModel):
'''
Implements DeepLabV3 model from
`"Rethinking Atrous Convolution for Semantic Image Segmentation"
<https://arxiv.org/abs/1706.05587>`_.
Args:
backbone (nn.Module): the network used to compute the features for the model.
The backbone ... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 17 | 2 | 2 | 1 | 1 | 13 | 2 | 1 | 1 | 0 | 2 | 0 | 0 |
18,426 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/deeplabv3.py | torchvision.models.segmentation.deeplabv3.DeepLabV3_MobileNet_V3_Large_Weights | from functools import partial
from ...transforms._presets import SemanticSegmentation
from .._api import register_model, Weights, WeightsEnum
class DeepLabV3_MobileNet_V3_Large_Weights(WeightsEnum):
COCO_WITH_VOC_LABELS_V1 = Weights(url='https://download.pytorch.org/models/deeplabv3_mobilenet_v3_large-fc3c493d.pth... |
class DeepLabV3_MobileNet_V3_Large_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 19 | 0 | 19 | 3 | 18 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,427 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/deeplabv3.py | torchvision.models.segmentation.deeplabv3.DeepLabV3_ResNet101_Weights | from ...transforms._presets import SemanticSegmentation
from .._api import register_model, Weights, WeightsEnum
from functools import partial
class DeepLabV3_ResNet101_Weights(WeightsEnum):
COCO_WITH_VOC_LABELS_V1 = Weights(url='https://download.pytorch.org/models/deeplabv3_resnet101_coco-586e9e4e.pth', transforms... |
class DeepLabV3_ResNet101_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 19 | 0 | 19 | 3 | 18 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,428 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/deeplabv3.py | torchvision.models.segmentation.deeplabv3.DeepLabV3_ResNet50_Weights | from .._api import register_model, Weights, WeightsEnum
from functools import partial
from ...transforms._presets import SemanticSegmentation
class DeepLabV3_ResNet50_Weights(WeightsEnum):
COCO_WITH_VOC_LABELS_V1 = Weights(url='https://download.pytorch.org/models/deeplabv3_resnet50_coco-cd0a2569.pth', transforms=p... |
class DeepLabV3_ResNet50_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 19 | 0 | 19 | 3 | 18 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,429 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/fcn.py | torchvision.models.segmentation.fcn.FCN | from ._utils import _SimpleSegmentationModel
class FCN(_SimpleSegmentationModel):
"""
Implements FCN model from
`"Fully Convolutional Networks for Semantic Segmentation"
<https://arxiv.org/abs/1411.4038>`_.
Args:
backbone (nn.Module): the network used to compute the features for the model.... |
class FCN(_SimpleSegmentationModel):
'''
Implements FCN model from
`"Fully Convolutional Networks for Semantic Segmentation"
<https://arxiv.org/abs/1411.4038>`_.
Args:
backbone (nn.Module): the network used to compute the features for the model.
The backbone should return an Ord... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 17 | 2 | 2 | 1 | 1 | 13 | 2 | 1 | 1 | 0 | 2 | 0 | 0 |
18,430 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/fcn.py | torchvision.models.segmentation.fcn.FCNHead | from torch import nn
class FCNHead(nn.Sequential):
def __init__(self, in_channels: int, channels: int) -> None:
inter_channels = in_channels // 4
layers = [nn.Conv2d(in_channels, inter_channels, 3, padding=1, bias=False), nn.BatchNorm2d(inter_channels), nn.ReLU(), nn.Dropout(0.1), nn.Conv2d(inter_... |
class FCNHead(nn.Sequential):
def __init__(self, in_channels: int, channels: int) -> None:
pass | 2 | 0 | 11 | 1 | 10 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 1 | 12 | 1 | 11 | 4 | 9 | 0 | 5 | 4 | 3 | 1 | 1 | 0 | 1 |
18,431 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/fcn.py | torchvision.models.segmentation.fcn.FCN_ResNet101_Weights | from .._api import register_model, Weights, WeightsEnum
from functools import partial
from ...transforms._presets import SemanticSegmentation
class FCN_ResNet101_Weights(WeightsEnum):
COCO_WITH_VOC_LABELS_V1 = Weights(url='https://download.pytorch.org/models/fcn_resnet101_coco-7ecb50ca.pth', transforms=partial(Sem... |
class FCN_ResNet101_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 19 | 0 | 19 | 3 | 18 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,432 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/fcn.py | torchvision.models.segmentation.fcn.FCN_ResNet50_Weights | from ...transforms._presets import SemanticSegmentation
from functools import partial
from .._api import register_model, Weights, WeightsEnum
class FCN_ResNet50_Weights(WeightsEnum):
COCO_WITH_VOC_LABELS_V1 = Weights(url='https://download.pytorch.org/models/fcn_resnet50_coco-1167a1af.pth', transforms=partial(Seman... |
class FCN_ResNet50_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 19 | 0 | 19 | 3 | 18 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,433 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/lraspp.py | torchvision.models.segmentation.lraspp.LRASPP | from collections import OrderedDict
from torch.nn import functional as F
from torch import nn, Tensor
from ...utils import _log_api_usage_once
class LRASPP(nn.Module):
"""
Implements a Lite R-ASPP Network for semantic segmentation from
`"Searching for MobileNetV3"
<https://arxiv.org/abs/1905.02244>`_.
... |
class LRASPP(nn.Module):
'''
Implements a Lite R-ASPP Network for semantic segmentation from
`"Searching for MobileNetV3"
<https://arxiv.org/abs/1905.02244>`_.
Args:
backbone (nn.Module): the network used to compute the features for the model.
The backbone should return an Order... | 3 | 1 | 8 | 1 | 7 | 0 | 1 | 0.87 | 1 | 6 | 1 | 0 | 2 | 2 | 2 | 12 | 33 | 5 | 15 | 10 | 10 | 13 | 13 | 8 | 10 | 1 | 1 | 0 | 2 |
18,434 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/lraspp.py | torchvision.models.segmentation.lraspp.LRASPPHead | from torch import nn, Tensor
from torch.nn import functional as F
class LRASPPHead(nn.Module):
def __init__(self, low_channels: int, high_channels: int, num_classes: int, inter_channels: int) -> None:
super().__init__()
self.cbr = nn.Sequential(nn.Conv2d(high_channels, inter_channels, 1, bias=Fals... |
class LRASPPHead(nn.Module):
def __init__(self, low_channels: int, high_channels: int, num_classes: int, inter_channels: int) -> None:
pass
def forward(self, input: dict[str, Tensor]) -> Tensor:
pass | 3 | 0 | 12 | 1 | 11 | 0 | 1 | 0 | 1 | 4 | 0 | 0 | 2 | 4 | 2 | 12 | 26 | 3 | 23 | 11 | 20 | 0 | 15 | 11 | 12 | 1 | 1 | 0 | 2 |
18,435 | pytorch/vision | pytorch_vision/torchvision/models/segmentation/lraspp.py | torchvision.models.segmentation.lraspp.LRASPP_MobileNet_V3_Large_Weights | from ...transforms._presets import SemanticSegmentation
from functools import partial
from .._api import register_model, Weights, WeightsEnum
from .._meta import _VOC_CATEGORIES
class LRASPP_MobileNet_V3_Large_Weights(WeightsEnum):
COCO_WITH_VOC_LABELS_V1 = Weights(url='https://download.pytorch.org/models/lraspp_m... |
class LRASPP_MobileNet_V3_Large_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 24 | 0 | 24 | 3 | 23 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,436 | pytorch/vision | pytorch_vision/torchvision/models/shufflenetv2.py | torchvision.models.shufflenetv2.InvertedResidual | import torch
from torch import Tensor
import torch.nn as nn
class InvertedResidual(nn.Module):
def __init__(self, inp: int, oup: int, stride: int) -> None:
super().__init__()
if not 1 <= stride <= 3:
raise ValueError('illegal stride value')
self.stride = stride
branch_f... |
class InvertedResidual(nn.Module):
def __init__(self, inp: int, oup: int, stride: int) -> None:
pass
@staticmethod
def depthwise_conv(i: int, o: int, kernel_size: int, stride: int=1, padding: int=0, bias: bool=False) -> nn.Conv2d:
pass
def forward(self, x: Tensor) -> Tensor:
p... | 5 | 0 | 18 | 2 | 16 | 0 | 3 | 0 | 1 | 5 | 0 | 1 | 2 | 3 | 3 | 13 | 59 | 8 | 51 | 13 | 44 | 0 | 22 | 10 | 18 | 5 | 1 | 1 | 8 |
18,437 | pytorch/vision | pytorch_vision/torchvision/models/shufflenetv2.py | torchvision.models.shufflenetv2.ShuffleNetV2 | from ..utils import _log_api_usage_once
import torch.nn as nn
from torch import Tensor
from typing import Any, Callable, Optional
class ShuffleNetV2(nn.Module):
def __init__(self, stages_repeats: list[int], stages_out_channels: list[int], num_classes: int=1000, inverted_residual: Callable[..., nn.Module]=Inverted... |
class ShuffleNetV2(nn.Module):
def __init__(self, stages_repeats: list[int], stages_out_channels: list[int], num_classes: int=1000, inverted_residual: Callable[..., nn.Module]=InvertedResidual) -> None:
pass
def _forward_impl(self, x: Tensor) -> Tensor:
pass
def forward(self, x: Tensor) ... | 4 | 0 | 20 | 2 | 17 | 1 | 2 | 0.06 | 1 | 7 | 1 | 1 | 3 | 5 | 3 | 13 | 63 | 8 | 53 | 20 | 43 | 3 | 39 | 14 | 35 | 5 | 1 | 2 | 7 |
18,438 | pytorch/vision | pytorch_vision/torchvision/models/shufflenetv2.py | torchvision.models.shufflenetv2.ShuffleNet_V2_X0_5_Weights | from ._api import register_model, Weights, WeightsEnum
from functools import partial
from ..transforms._presets import ImageClassification
class ShuffleNet_V2_X0_5_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/shufflenetv2_x0.5-f707e7126e.pth', transforms=partial(ImageClass... |
class ShuffleNet_V2_X0_5_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 20 | 0 | 19 | 3 | 18 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,439 | pytorch/vision | pytorch_vision/torchvision/models/shufflenetv2.py | torchvision.models.shufflenetv2.ShuffleNet_V2_X1_0_Weights | from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification
from functools import partial
class ShuffleNet_V2_X1_0_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/shufflenetv2_x1-5666bf0f80.pth', transforms=partial(ImageClassif... |
class ShuffleNet_V2_X1_0_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 20 | 0 | 19 | 3 | 18 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,440 | pytorch/vision | pytorch_vision/torchvision/models/shufflenetv2.py | torchvision.models.shufflenetv2.ShuffleNet_V2_X1_5_Weights | from functools import partial
from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification
class ShuffleNet_V2_X1_5_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/shufflenetv2_x1_5-3c479a10.pth', transforms=partial(ImageClassif... |
class ShuffleNet_V2_X1_5_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 23 | 0 | 23 | 3 | 22 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,441 | pytorch/vision | pytorch_vision/torchvision/models/shufflenetv2.py | torchvision.models.shufflenetv2.ShuffleNet_V2_X2_0_Weights | from ..transforms._presets import ImageClassification
from functools import partial
from ._api import register_model, Weights, WeightsEnum
class ShuffleNet_V2_X2_0_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/shufflenetv2_x2_0-8be3c8ee.pth', transforms=partial(ImageClassif... |
class ShuffleNet_V2_X2_0_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 23 | 0 | 23 | 3 | 22 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,442 | pytorch/vision | pytorch_vision/torchvision/models/squeezenet.py | torchvision.models.squeezenet.Fire | import torch
import torch.nn as nn
import torch.nn.init as init
class Fire(nn.Module):
def __init__(self, inplanes: int, squeeze_planes: int, expand1x1_planes: int, expand3x3_planes: int) -> None:
super().__init__()
self.inplanes = inplanes
self.squeeze = nn.Conv2d(inplanes, squeeze_planes... |
class Fire(nn.Module):
def __init__(self, inplanes: int, squeeze_planes: int, expand1x1_planes: int, expand3x3_planes: int) -> None:
pass
def forward(self, x: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 1 | 3 | 0 | 0 | 2 | 7 | 2 | 12 | 16 | 1 | 15 | 10 | 12 | 0 | 13 | 10 | 10 | 1 | 1 | 0 | 2 |
18,443 | pytorch/vision | pytorch_vision/torchvision/models/squeezenet.py | torchvision.models.squeezenet.SqueezeNet | import torch
from ..utils import _log_api_usage_once
import torch.nn as nn
import torch.nn.init as init
class SqueezeNet(nn.Module):
def __init__(self, version: str='1_0', num_classes: int=1000, dropout: float=0.5) -> None:
super().__init__()
_log_api_usage_once(self)
self.num_classes = nu... |
class SqueezeNet(nn.Module):
def __init__(self, version: str='1_0', num_classes: int=1000, dropout: float=0.5) -> None:
pass
def forward(self, x: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 30 | 1 | 27 | 2 | 4 | 0.07 | 1 | 7 | 1 | 0 | 2 | 3 | 2 | 12 | 62 | 3 | 55 | 8 | 52 | 4 | 22 | 8 | 19 | 7 | 1 | 3 | 8 |
18,444 | pytorch/vision | pytorch_vision/torchvision/models/squeezenet.py | torchvision.models.squeezenet.SqueezeNet1_0_Weights | from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification
from functools import partial
class SqueezeNet1_0_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/squeezenet1_0-b66bff10.pth', transforms=partial(ImageClassification, ... |
class SqueezeNet1_0_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 19 | 0 | 19 | 3 | 18 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,445 | pytorch/vision | pytorch_vision/torchvision/models/squeezenet.py | torchvision.models.squeezenet.SqueezeNet1_1_Weights | from functools import partial
from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification
class SqueezeNet1_1_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/squeezenet1_1-b8a52dc0.pth', transforms=partial(ImageClassification, ... |
class SqueezeNet1_1_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 19 | 0 | 19 | 3 | 18 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,446 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.PatchMerging | from ..utils import _log_api_usage_once
from typing import Any, Callable, Optional
from torch import nn, Tensor
class PatchMerging(nn.Module):
"""Patch Merging Layer.
Args:
dim (int): Number of input channels.
norm_layer (nn.Module): Normalization layer. Default: nn.LayerNorm.
"""
def ... |
class PatchMerging(nn.Module):
'''Patch Merging Layer.
Args:
dim (int): Number of input channels.
norm_layer (nn.Module): Normalization layer. Default: nn.LayerNorm.
'''
def __init__(self, dim: int, norm_layer: Callable[..., nn.Module]=nn.LayerNorm):
pass
def forward(self,... | 3 | 2 | 9 | 0 | 6 | 4 | 1 | 1 | 1 | 3 | 0 | 0 | 2 | 3 | 2 | 12 | 25 | 2 | 12 | 6 | 9 | 12 | 12 | 6 | 9 | 1 | 1 | 0 | 2 |
18,447 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.PatchMergingV2 | from ..utils import _log_api_usage_once
from typing import Any, Callable, Optional
from torch import nn, Tensor
class PatchMergingV2(nn.Module):
"""Patch Merging Layer for Swin Transformer V2.
Args:
dim (int): Number of input channels.
norm_layer (nn.Module): Normalization layer. Default: nn.La... |
class PatchMergingV2(nn.Module):
'''Patch Merging Layer for Swin Transformer V2.
Args:
dim (int): Number of input channels.
norm_layer (nn.Module): Normalization layer. Default: nn.LayerNorm.
'''
def __init__(self, dim: int, norm_layer: Callable[..., nn.Module]=nn.LayerNorm):
p... | 3 | 2 | 9 | 0 | 6 | 4 | 1 | 1.08 | 1 | 3 | 0 | 0 | 2 | 3 | 2 | 12 | 25 | 2 | 12 | 6 | 9 | 13 | 12 | 6 | 9 | 1 | 1 | 0 | 2 |
18,448 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.ShiftedWindowAttention | from torch import nn, Tensor
import torch.nn.functional as F
import torch
class ShiftedWindowAttention(nn.Module):
"""
See :func:`shifted_window_attention`.
"""
def __init__(self, dim: int, window_size: list[int], shift_size: list[int], num_heads: int, qkv_bias: bool=True, proj_bias: bool=True, attent... |
class ShiftedWindowAttention(nn.Module):
'''
See :func:`shifted_window_attention`.
'''
def __init__(self, dim: int, window_size: list[int], shift_size: list[int], num_heads: int, qkv_bias: bool=True, proj_bias: bool=True, attention_dropout: float=0.0, dropout: float=0.0):
pass
def define_... | 6 | 2 | 14 | 0 | 12 | 3 | 1 | 0.31 | 1 | 6 | 0 | 1 | 5 | 8 | 5 | 15 | 79 | 7 | 61 | 31 | 45 | 19 | 34 | 21 | 28 | 2 | 1 | 1 | 6 |
18,449 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.ShiftedWindowAttentionV2 | import torch.nn.functional as F
import torch
from torch import nn, Tensor
class ShiftedWindowAttentionV2(ShiftedWindowAttention):
"""
See :func:`shifted_window_attention_v2`.
"""
def __init__(self, dim: int, window_size: list[int], shift_size: list[int], num_heads: int, qkv_bias: bool=True, proj_bias:... |
class ShiftedWindowAttentionV2(ShiftedWindowAttention):
'''
See :func:`shifted_window_attention_v2`.
'''
def __init__(self, dim: int, window_size: list[int], shift_size: list[int], num_heads: int, qkv_bias: bool=True, proj_bias: bool=True, attention_dropout: float=0.0, dropout: float=0.0):
pas... | 5 | 2 | 19 | 1 | 16 | 3 | 1 | 0.21 | 1 | 5 | 0 | 0 | 4 | 7 | 4 | 19 | 84 | 7 | 66 | 28 | 51 | 14 | 25 | 13 | 20 | 2 | 2 | 1 | 5 |
18,450 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.SwinTransformer | from functools import partial
from ..ops.misc import MLP, Permute
from torch import nn, Tensor
from ..utils import _log_api_usage_once
from typing import Any, Callable, Optional
class SwinTransformer(nn.Module):
"""
Implements Swin Transformer from the `"Swin Transformer: Hierarchical Vision Transformer using
... |
class SwinTransformer(nn.Module):
'''
Implements Swin Transformer from the `"Swin Transformer: Hierarchical Vision Transformer using
Shifted Windows" <https://arxiv.org/abs/2103.14030>`_ paper.
Args:
patch_size (List[int]): Patch size.
embed_dim (int): Patch embedding dimension.
... | 3 | 1 | 43 | 3 | 39 | 3 | 6 | 0.29 | 1 | 8 | 3 | 0 | 2 | 7 | 2 | 12 | 107 | 7 | 78 | 35 | 60 | 23 | 43 | 20 | 40 | 10 | 1 | 3 | 11 |
18,451 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.SwinTransformerBlock | from ..ops.misc import MLP, Permute
from ..utils import _log_api_usage_once
from ..ops.stochastic_depth import StochasticDepth
from torch import nn, Tensor
from typing import Any, Callable, Optional
class SwinTransformerBlock(nn.Module):
"""
Swin Transformer Block.
Args:
dim (int): Number of input ... |
class SwinTransformerBlock(nn.Module):
'''
Swin Transformer Block.
Args:
dim (int): Number of input channels.
num_heads (int): Number of attention heads.
window_size (List[int]): Window size.
shift_size (List[int]): Shift size for shifted window attention.
mlp_ratio ... | 3 | 1 | 19 | 1 | 18 | 0 | 3 | 0.38 | 1 | 7 | 3 | 1 | 2 | 5 | 2 | 12 | 55 | 4 | 37 | 21 | 22 | 14 | 18 | 9 | 15 | 4 | 1 | 3 | 5 |
18,452 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.SwinTransformerBlockV2 | from torch import nn, Tensor
from typing import Any, Callable, Optional
class SwinTransformerBlockV2(SwinTransformerBlock):
"""
Swin Transformer V2 Block.
Args:
dim (int): Number of input channels.
num_heads (int): Number of attention heads.
window_size (List[int]): Window size.
... |
class SwinTransformerBlockV2(SwinTransformerBlock):
'''
Swin Transformer V2 Block.
Args:
dim (int): Number of input channels.
num_heads (int): Number of attention heads.
window_size (List[int]): Window size.
shift_size (List[int]): Shift size for shifted window attention.
... | 3 | 1 | 16 | 0 | 15 | 1 | 1 | 0.53 | 1 | 5 | 1 | 0 | 2 | 0 | 2 | 14 | 48 | 2 | 30 | 15 | 15 | 16 | 7 | 3 | 4 | 1 | 2 | 0 | 2 |
18,453 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.Swin_B_Weights | from ..transforms._presets import ImageClassification, InterpolationMode
from ._api import register_model, Weights, WeightsEnum
from functools import partial
class Swin_B_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/swin_b-68c6b09e.pth', transforms=partial(ImageClassificat... |
class Swin_B_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 23 | 0 | 23 | 3 | 22 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,454 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.Swin_S_Weights | from functools import partial
from ..transforms._presets import ImageClassification, InterpolationMode
from ._api import register_model, Weights, WeightsEnum
class Swin_S_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/swin_s-5e29d889.pth', transforms=partial(ImageClassificat... |
class Swin_S_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 23 | 0 | 23 | 3 | 22 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,455 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.Swin_T_Weights | from functools import partial
from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification, InterpolationMode
class Swin_T_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/swin_t-704ceda3.pth', transforms=partial(ImageClassificat... |
class Swin_T_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 23 | 0 | 23 | 3 | 22 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,456 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.Swin_V2_B_Weights | from ._api import register_model, Weights, WeightsEnum
from functools import partial
from ..transforms._presets import ImageClassification, InterpolationMode
class Swin_V2_B_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/swin_v2_b-781e5279.pth', transforms=partial(ImageClass... |
class Swin_V2_B_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 23 | 0 | 23 | 3 | 22 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,457 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.Swin_V2_S_Weights | from ._api import register_model, Weights, WeightsEnum
from functools import partial
from ..transforms._presets import ImageClassification, InterpolationMode
class Swin_V2_S_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/swin_v2_s-637d8ceb.pth', transforms=partial(ImageClass... |
class Swin_V2_S_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 23 | 0 | 23 | 3 | 22 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,458 | pytorch/vision | pytorch_vision/torchvision/models/swin_transformer.py | torchvision.models.swin_transformer.Swin_V2_T_Weights | from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification, InterpolationMode
from functools import partial
class Swin_V2_T_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/swin_v2_t-b137f0e2.pth', transforms=partial(ImageClass... |
class Swin_V2_T_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 23 | 0 | 23 | 3 | 22 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,459 | pytorch/vision | pytorch_vision/torchvision/models/vgg.py | torchvision.models.vgg.VGG | import torch.nn as nn
import torch
from ..utils import _log_api_usage_once
class VGG(nn.Module):
def __init__(self, features: nn.Module, num_classes: int=1000, init_weights: bool=True, dropout: float=0.5) -> None:
super().__init__()
_log_api_usage_once(self)
self.features = features
... |
class VGG(nn.Module):
def __init__(self, features: nn.Module, num_classes: int=1000, init_weights: bool=True, dropout: float=0.5) -> None:
pass
def forward(self, x: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 17 | 0 | 17 | 0 | 4 | 0 | 1 | 5 | 0 | 0 | 2 | 3 | 2 | 12 | 36 | 1 | 35 | 9 | 30 | 0 | 23 | 7 | 20 | 7 | 1 | 4 | 8 |
18,460 | pytorch/vision | pytorch_vision/torchvision/models/vgg.py | torchvision.models.vgg.VGG11_BN_Weights | from functools import partial
from ..transforms._presets import ImageClassification
from ._api import register_model, Weights, WeightsEnum
class VGG11_BN_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/vgg11_bn-6002323d.pth', transforms=partial(ImageClassification, crop_size=... |
class VGG11_BN_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 18 | 0 | 18 | 3 | 17 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,461 | pytorch/vision | pytorch_vision/torchvision/models/vgg.py | torchvision.models.vgg.VGG11_Weights | from functools import partial
from ..transforms._presets import ImageClassification
from ._api import register_model, Weights, WeightsEnum
class VGG11_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/vgg11-8a719046.pth', transforms=partial(ImageClassification, crop_size=224), ... |
class VGG11_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 18 | 0 | 18 | 3 | 17 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,462 | pytorch/vision | pytorch_vision/torchvision/models/vgg.py | torchvision.models.vgg.VGG13_BN_Weights | from functools import partial
from ..transforms._presets import ImageClassification
from ._api import register_model, Weights, WeightsEnum
class VGG13_BN_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/vgg13_bn-abd245e5.pth', transforms=partial(ImageClassification, crop_size=... |
class VGG13_BN_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 18 | 0 | 18 | 3 | 17 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,463 | pytorch/vision | pytorch_vision/torchvision/models/vgg.py | torchvision.models.vgg.VGG13_Weights | from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification
from functools import partial
class VGG13_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/vgg13-19584684.pth', transforms=partial(ImageClassification, crop_size=224), ... |
class VGG13_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 18 | 0 | 18 | 3 | 17 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,464 | pytorch/vision | pytorch_vision/torchvision/models/vgg.py | torchvision.models.vgg.VGG16_BN_Weights | from functools import partial
from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification
class VGG16_BN_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/vgg16_bn-6c64b313.pth', transforms=partial(ImageClassification, crop_size=... |
class VGG16_BN_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 18 | 0 | 18 | 3 | 17 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,465 | pytorch/vision | pytorch_vision/torchvision/models/vgg.py | torchvision.models.vgg.VGG16_Weights | from ..transforms._presets import ImageClassification
from functools import partial
from ._api import register_model, Weights, WeightsEnum
class VGG16_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/vgg16-397923af.pth', transforms=partial(ImageClassification, crop_size=224), ... |
class VGG16_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 47 | 0 | 46 | 4 | 45 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,466 | pytorch/vision | pytorch_vision/torchvision/models/vgg.py | torchvision.models.vgg.VGG19_BN_Weights | from ..transforms._presets import ImageClassification
from functools import partial
from ._api import register_model, Weights, WeightsEnum
class VGG19_BN_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/vgg19_bn-c79401a0.pth', transforms=partial(ImageClassification, crop_size=... |
class VGG19_BN_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 18 | 0 | 18 | 3 | 17 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,467 | pytorch/vision | pytorch_vision/torchvision/models/vgg.py | torchvision.models.vgg.VGG19_Weights | from functools import partial
from ._api import register_model, Weights, WeightsEnum
from ..transforms._presets import ImageClassification
class VGG19_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(url='https://download.pytorch.org/models/vgg19-dcbb9e9d.pth', transforms=partial(ImageClassification, crop_size=224), ... |
class VGG19_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 18 | 0 | 18 | 3 | 17 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,468 | pytorch/vision | pytorch_vision/torchvision/models/video/mvit.py | torchvision.models.video.mvit.MSBlockConfig | from dataclasses import dataclass
@dataclass
class MSBlockConfig:
num_heads: int
input_channels: int
output_channels: int
kernel_q: list[int]
kernel_kv: list[int]
stride_q: list[int]
stride_kv: list[int] | @dataclass
class MSBlockConfig:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0 | 8 | 1 | 7 | 0 | 8 | 1 | 7 | 0 | 0 | 0 | 0 |
18,469 | pytorch/vision | pytorch_vision/torchvision/models/video/mvit.py | torchvision.models.video.mvit.MViT | from typing import Any, Callable, Optional
import torch.fx
from ...utils import _log_api_usage_once
import torch.nn as nn
from functools import partial
import torch
from collections.abc import Sequence
class MViT(nn.Module):
def __init__(self, spatial_size: tuple[int, int], temporal_size: int, block_setting: Sequ... |
class MViT(nn.Module):
def __init__(self, spatial_size: tuple[int, int], temporal_size: int, block_setting: Sequence[MSBlockConfig], residual_pool: bool, residual_with_cls_embed: bool, rel_pos_embed: bool, proj_after_attn: bool, dropout: float=0.5, attention_dropout: float=0.0, stochastic_depth_prob: float=0.0, n... | 3 | 1 | 70 | 8 | 45 | 18 | 8 | 0.38 | 1 | 12 | 3 | 0 | 2 | 5 | 2 | 12 | 142 | 16 | 91 | 34 | 70 | 35 | 45 | 16 | 42 | 14 | 1 | 3 | 16 |
18,470 | pytorch/vision | pytorch_vision/torchvision/models/video/mvit.py | torchvision.models.video.mvit.MViT_V1_B_Weights | from functools import partial
from .._meta import _KINETICS400_CATEGORIES
from ...transforms._presets import VideoClassification
from .._api import register_model, Weights, WeightsEnum
class MViT_V1_B_Weights(WeightsEnum):
KINETICS400_V1 = Weights(url='https://download.pytorch.org/models/mvit_v1_b-dbeb1030.pth', t... |
class MViT_V1_B_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 31 | 0 | 31 | 3 | 30 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,471 | pytorch/vision | pytorch_vision/torchvision/models/video/mvit.py | torchvision.models.video.mvit.MViT_V2_S_Weights | from .._api import register_model, Weights, WeightsEnum
from .._meta import _KINETICS400_CATEGORIES
from functools import partial
from ...transforms._presets import VideoClassification
class MViT_V2_S_Weights(WeightsEnum):
KINETICS400_V1 = Weights(url='https://download.pytorch.org/models/mvit_v2_s-ae3be167.pth', t... |
class MViT_V2_S_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 31 | 0 | 31 | 3 | 30 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,472 | pytorch/vision | pytorch_vision/torchvision/models/video/mvit.py | torchvision.models.video.mvit.MultiscaleAttention | import torch.fx
import torch.nn as nn
import torch
from typing import Any, Callable, Optional
import math
class MultiscaleAttention(nn.Module):
def __init__(self, input_size: list[int], embed_dim: int, output_dim: int, num_heads: int, kernel_q: list[int], kernel_kv: list[int], stride_q: list[int], stride_kv: list... |
class MultiscaleAttention(nn.Module):
def __init__(self, input_size: list[int], embed_dim: int, output_dim: int, num_heads: int, kernel_q: list[int], kernel_kv: list[int], stride_q: list[int], stride_kv: list[int], residual_pool: bool, residual_with_cls_embed: bool, rel_pos_embed: bool, dropout: float=0.0, norm_l... | 3 | 0 | 62 | 4 | 58 | 5 | 7 | 0.08 | 1 | 6 | 1 | 0 | 2 | 15 | 2 | 12 | 126 | 9 | 117 | 45 | 99 | 9 | 60 | 30 | 57 | 7 | 1 | 1 | 13 |
18,473 | pytorch/vision | pytorch_vision/torchvision/models/video/mvit.py | torchvision.models.video.mvit.MultiscaleBlock | import torch
from typing import Any, Callable, Optional
import torch.fx
import torch.nn as nn
from ...ops import MLP, StochasticDepth
class MultiscaleBlock(nn.Module):
def __init__(self, input_size: list[int], cnf: MSBlockConfig, residual_pool: bool, residual_with_cls_embed: bool, rel_pos_embed: bool, proj_after_... |
class MultiscaleBlock(nn.Module):
def __init__(self, input_size: list[int], cnf: MSBlockConfig, residual_pool: bool, residual_with_cls_embed: bool, rel_pos_embed: bool, proj_after_attn: bool, dropout: float=0.0, stochastic_depth_prob: float=0.0, norm_layer: Callable[..., nn.Module]=nn.LayerNorm) -> None:
... | 3 | 0 | 34 | 4 | 30 | 1 | 6 | 0.02 | 1 | 10 | 5 | 0 | 2 | 9 | 2 | 12 | 70 | 9 | 61 | 31 | 47 | 1 | 28 | 20 | 25 | 6 | 1 | 1 | 11 |
18,474 | pytorch/vision | pytorch_vision/torchvision/models/video/mvit.py | torchvision.models.video.mvit.Pool | import torch
import torch.fx
from typing import Any, Callable, Optional
import torch.nn as nn
class Pool(nn.Module):
def __init__(self, pool: nn.Module, norm: Optional[nn.Module], activation: Optional[nn.Module]=None, norm_before_pool: bool=False) -> None:
super().__init__()
self.pool = pool
... |
class Pool(nn.Module):
def __init__(self, pool: nn.Module, norm: Optional[nn.Module], activation: Optional[nn.Module]=None, norm_before_pool: bool=False) -> None:
pass
def forward(self, x: torch.Tensor, thw: tuple[int, int, int]) -> tuple[torch.Tensor, tuple[int, int, int]]:
pass | 3 | 0 | 20 | 3 | 16 | 2 | 4 | 0.09 | 1 | 4 | 0 | 0 | 2 | 3 | 2 | 12 | 42 | 6 | 33 | 17 | 24 | 3 | 27 | 11 | 24 | 4 | 1 | 1 | 7 |
18,475 | pytorch/vision | pytorch_vision/torchvision/models/video/mvit.py | torchvision.models.video.mvit.PositionalEncoding | import torch.fx
import torch.nn as nn
import torch
from typing import Any, Callable, Optional
class PositionalEncoding(nn.Module):
def __init__(self, embed_size: int, spatial_size: tuple[int, int], temporal_size: int, rel_pos_embed: bool) -> None:
super().__init__()
self.spatial_size = spatial_siz... |
class PositionalEncoding(nn.Module):
def __init__(self, embed_size: int, spatial_size: tuple[int, int], temporal_size: int, rel_pos_embed: bool) -> None:
pass
def forward(self, x: torch.Tensor) -> torch.Tensor:
pass | 3 | 0 | 13 | 2 | 11 | 0 | 2 | 0 | 1 | 4 | 0 | 0 | 2 | 6 | 2 | 12 | 27 | 4 | 23 | 12 | 20 | 0 | 23 | 12 | 20 | 2 | 1 | 1 | 4 |
18,476 | pytorch/vision | pytorch_vision/torchvision/models/video/resnet.py | torchvision.models.video.resnet.BasicBlock | from typing import Any, Callable, Optional, Union
from torch import Tensor
import torch.nn as nn
class BasicBlock(nn.Module):
expansion = 1
def __init__(self, inplanes: int, planes: int, conv_builder: Callable[..., nn.Module], stride: int=1, downsample: Optional[nn.Module]=None) -> None:
midplanes = i... |
class BasicBlock(nn.Module):
def __init__(self, inplanes: int, planes: int, conv_builder: Callable[..., nn.Module], stride: int=1, downsample: Optional[nn.Module]=None) -> None:
pass
def forward(self, x: Tensor) -> Tensor:
pass | 3 | 0 | 15 | 2 | 13 | 0 | 2 | 0 | 1 | 3 | 0 | 0 | 2 | 5 | 2 | 12 | 35 | 7 | 28 | 19 | 18 | 0 | 19 | 12 | 16 | 2 | 1 | 1 | 3 |
18,477 | pytorch/vision | pytorch_vision/torchvision/models/video/resnet.py | torchvision.models.video.resnet.BasicStem | import torch.nn as nn
class BasicStem(nn.Sequential):
"""The default conv-batchnorm-relu stem"""
def __init__(self) -> None:
super().__init__(nn.Conv3d(3, 64, kernel_size=(3, 7, 7), stride=(1, 2, 2), padding=(1, 3, 3), bias=False), nn.BatchNorm3d(64), nn.ReLU(inplace=True)) |
class BasicStem(nn.Sequential):
'''The default conv-batchnorm-relu stem'''
def __init__(self) -> None:
pass | 2 | 1 | 6 | 0 | 6 | 0 | 1 | 0.14 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 9 | 1 | 7 | 2 | 5 | 1 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
18,478 | pytorch/vision | pytorch_vision/torchvision/models/video/resnet.py | torchvision.models.video.resnet.Bottleneck | from torch import Tensor
import torch.nn as nn
from typing import Any, Callable, Optional, Union
class Bottleneck(nn.Module):
expansion = 4
def __init__(self, inplanes: int, planes: int, conv_builder: Callable[..., nn.Module], stride: int=1, downsample: Optional[nn.Module]=None) -> None:
super().__ini... |
class Bottleneck(nn.Module):
def __init__(self, inplanes: int, planes: int, conv_builder: Callable[..., nn.Module], stride: int=1, downsample: Optional[nn.Module]=None) -> None:
pass
def forward(self, x: Tensor) -> Tensor:
pass | 3 | 0 | 22 | 4 | 17 | 2 | 2 | 0.09 | 1 | 3 | 0 | 0 | 2 | 6 | 2 | 12 | 47 | 9 | 35 | 20 | 25 | 3 | 21 | 13 | 18 | 2 | 1 | 1 | 3 |
18,479 | pytorch/vision | pytorch_vision/torchvision/models/video/resnet.py | torchvision.models.video.resnet.Conv2Plus1D | import torch.nn as nn
class Conv2Plus1D(nn.Sequential):
def __init__(self, in_planes: int, out_planes: int, midplanes: int, stride: int=1, padding: int=1) -> None:
super().__init__(nn.Conv3d(in_planes, midplanes, kernel_size=(1, 3, 3), stride=(1, stride, stride), padding=(0, padding, padding), bias=False)... |
class Conv2Plus1D(nn.Sequential):
def __init__(self, in_planes: int, out_planes: int, midplanes: int, stride: int=1, padding: int=1) -> None:
pass
@staticmethod
def get_downsample_stride(stride: int) -> tuple[int, int, int]:
pass | 4 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 2 | 2 | 21 | 1 | 20 | 4 | 16 | 0 | 5 | 3 | 2 | 1 | 1 | 0 | 2 |
18,480 | pytorch/vision | pytorch_vision/torchvision/models/video/resnet.py | torchvision.models.video.resnet.Conv3DNoTemporal | from typing import Any, Callable, Optional, Union
import torch.nn as nn
class Conv3DNoTemporal(nn.Conv3d):
def __init__(self, in_planes: int, out_planes: int, midplanes: Optional[int]=None, stride: int=1, padding: int=1) -> None:
super().__init__(in_channels=in_planes, out_channels=out_planes, kernel_size... |
class Conv3DNoTemporal(nn.Conv3d):
def __init__(self, in_planes: int, out_planes: int, midplanes: Optional[int]=None, stride: int=1, padding: int=1) -> None:
pass
@staticmethod
def get_downsample_stride(stride: int) -> tuple[int, int, int]:
pass | 4 | 0 | 7 | 1 | 7 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 2 | 2 | 17 | 2 | 15 | 6 | 9 | 0 | 5 | 3 | 2 | 1 | 1 | 0 | 2 |
18,481 | pytorch/vision | pytorch_vision/torchvision/models/video/resnet.py | torchvision.models.video.resnet.Conv3DSimple | import torch.nn as nn
from typing import Any, Callable, Optional, Union
class Conv3DSimple(nn.Conv3d):
def __init__(self, in_planes: int, out_planes: int, midplanes: Optional[int]=None, stride: int=1, padding: int=1) -> None:
super().__init__(in_channels=in_planes, out_channels=out_planes, kernel_size=(3,... |
class Conv3DSimple(nn.Conv3d):
def __init__(self, in_planes: int, out_planes: int, midplanes: Optional[int]=None, stride: int=1, padding: int=1) -> None:
pass
@staticmethod
def get_downsample_stride(stride: int) -> tuple[int, int, int]:
pass | 4 | 0 | 7 | 1 | 7 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 2 | 2 | 17 | 2 | 15 | 6 | 9 | 0 | 5 | 3 | 2 | 1 | 1 | 0 | 2 |
18,482 | pytorch/vision | pytorch_vision/torchvision/models/video/resnet.py | torchvision.models.video.resnet.MC3_18_Weights | from .._api import register_model, Weights, WeightsEnum
from ...transforms._presets import VideoClassification
from functools import partial
class MC3_18_Weights(WeightsEnum):
KINETICS400_V1 = Weights(url='https://download.pytorch.org/models/mc3_18-a90a0ba3.pth', transforms=partial(VideoClassification, crop_size=(... |
class MC3_18_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 18 | 0 | 18 | 3 | 17 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,483 | pytorch/vision | pytorch_vision/torchvision/models/video/resnet.py | torchvision.models.video.resnet.R2Plus1D_18_Weights | from ...transforms._presets import VideoClassification
from functools import partial
from .._api import register_model, Weights, WeightsEnum
class R2Plus1D_18_Weights(WeightsEnum):
KINETICS400_V1 = Weights(url='https://download.pytorch.org/models/r2plus1d_18-91a641e6.pth', transforms=partial(VideoClassification, c... |
class R2Plus1D_18_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 18 | 0 | 18 | 3 | 17 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,484 | pytorch/vision | pytorch_vision/torchvision/models/video/resnet.py | torchvision.models.video.resnet.R2Plus1dStem | import torch.nn as nn
class R2Plus1dStem(nn.Sequential):
"""R(2+1)D stem is different than the default one as it uses separated 3D convolution"""
def __init__(self) -> None:
super().__init__(nn.Conv3d(3, 45, kernel_size=(1, 7, 7), stride=(1, 2, 2), padding=(0, 3, 3), bias=False), nn.BatchNorm3d(45), n... |
class R2Plus1dStem(nn.Sequential):
'''R(2+1)D stem is different than the default one as it uses separated 3D convolution'''
def __init__(self) -> None:
pass | 2 | 1 | 9 | 0 | 9 | 0 | 1 | 0.1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 12 | 1 | 10 | 2 | 8 | 1 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
18,485 | pytorch/vision | pytorch_vision/torchvision/models/video/resnet.py | torchvision.models.video.resnet.R3D_18_Weights | from ...transforms._presets import VideoClassification
from .._api import register_model, Weights, WeightsEnum
from functools import partial
class R3D_18_Weights(WeightsEnum):
KINETICS400_V1 = Weights(url='https://download.pytorch.org/models/r3d_18-b3b3357e.pth', transforms=partial(VideoClassification, crop_size=(... |
class R3D_18_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 18 | 0 | 18 | 3 | 17 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,486 | pytorch/vision | pytorch_vision/torchvision/models/video/resnet.py | torchvision.models.video.resnet.VideoResNet | import torch.nn as nn
from typing import Any, Callable, Optional, Union
from torch import Tensor
from ...utils import _log_api_usage_once
from collections.abc import Sequence
class VideoResNet(nn.Module):
def __init__(self, block: type[Union[BasicBlock, Bottleneck]], conv_makers: Sequence[type[Union[Conv3DSimple,... |
class VideoResNet(nn.Module):
def __init__(self, block: type[Union[BasicBlock, Bottleneck]], conv_makers: Sequence[type[Union[Conv3DSimple, Conv3DNoTemporal, Conv2Plus1D]]], layers: list[int], stem: Callable[..., nn.Module], num_classes: int=400, zero_init_residual: bool=False) -> None:
'''Generic resnet ... | 4 | 1 | 30 | 4 | 22 | 4 | 4 | 0.2 | 1 | 10 | 5 | 0 | 3 | 8 | 3 | 13 | 92 | 14 | 66 | 32 | 47 | 13 | 46 | 17 | 42 | 9 | 1 | 3 | 13 |
18,487 | pytorch/vision | pytorch_vision/torchvision/models/video/s3d.py | torchvision.models.video.s3d.S3D | from torch import nn
from functools import partial
import torch
from typing import Any, Callable, Optional
from ...utils import _log_api_usage_once
from torchvision.ops.misc import Conv3dNormActivation
class S3D(nn.Module):
"""S3D main class.
Args:
num_class (int): number of classes for the classifica... |
class S3D(nn.Module):
'''S3D main class.
Args:
num_class (int): number of classes for the classification task.
dropout (float): dropout probability.
norm_layer (Optional[Callable]): Module specifying the normalization layer to use.
Inputs:
x (Tensor): batch of videos with di... | 3 | 1 | 24 | 1 | 23 | 0 | 2 | 0.17 | 1 | 7 | 3 | 0 | 2 | 3 | 2 | 12 | 60 | 6 | 46 | 11 | 38 | 8 | 15 | 6 | 12 | 2 | 1 | 1 | 3 |
18,488 | pytorch/vision | pytorch_vision/torchvision/models/video/s3d.py | torchvision.models.video.s3d.S3D_Weights | from .._meta import _KINETICS400_CATEGORIES
from functools import partial
from ...transforms._presets import VideoClassification
from .._api import register_model, Weights, WeightsEnum
class S3D_Weights(WeightsEnum):
KINETICS400_V1 = Weights(url='https://download.pytorch.org/models/s3d-d76dad2f.pth', transforms=pa... |
class S3D_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 29 | 0 | 29 | 3 | 28 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,489 | pytorch/vision | pytorch_vision/torchvision/models/video/s3d.py | torchvision.models.video.s3d.SepInceptionBlock3D | from torchvision.ops.misc import Conv3dNormActivation
from typing import Any, Callable, Optional
import torch
from torch import nn
class SepInceptionBlock3D(nn.Module):
def __init__(self, in_planes: int, b0_out: int, b1_mid: int, b1_out: int, b2_mid: int, b2_out: int, b3_out: int, norm_layer: Callable[..., nn.Mod... |
class SepInceptionBlock3D(nn.Module):
def __init__(self, in_planes: int, b0_out: int, b1_mid: int, b1_out: int, b2_mid: int, b2_out: int, b3_out: int, norm_layer: Callable[..., nn.Module]):
pass
def forward(self, x):
pass | 3 | 0 | 17 | 1 | 16 | 0 | 1 | 0 | 1 | 4 | 2 | 0 | 2 | 4 | 2 | 12 | 36 | 3 | 33 | 22 | 20 | 0 | 14 | 12 | 11 | 1 | 1 | 0 | 2 |
18,490 | pytorch/vision | pytorch_vision/torchvision/models/video/s3d.py | torchvision.models.video.s3d.TemporalSeparableConv | from typing import Any, Callable, Optional
from torch import nn
from torchvision.ops.misc import Conv3dNormActivation
class TemporalSeparableConv(nn.Sequential):
def __init__(self, in_planes: int, out_planes: int, kernel_size: int, stride: int, padding: int, norm_layer: Callable[..., nn.Module]):
super().... |
class TemporalSeparableConv(nn.Sequential):
def __init__(self, in_planes: int, out_planes: int, kernel_size: int, stride: int, padding: int, norm_layer: Callable[..., nn.Module]):
pass | 2 | 0 | 29 | 0 | 29 | 0 | 1 | 0 | 1 | 3 | 1 | 0 | 1 | 0 | 1 | 1 | 30 | 0 | 30 | 10 | 20 | 0 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
18,491 | pytorch/vision | pytorch_vision/torchvision/models/video/swin_transformer.py | torchvision.models.video.swin_transformer.PatchEmbed3d | from ...utils import _log_api_usage_once
import torch.nn.functional as F
from torch import nn, Tensor
from typing import Any, Callable, Optional
class PatchEmbed3d(nn.Module):
"""Video to Patch Embedding.
Args:
patch_size (List[int]): Patch token size.
in_channels (int): Number of input channe... |
class PatchEmbed3d(nn.Module):
'''Video to Patch Embedding.
Args:
patch_size (List[int]): Patch token size.
in_channels (int): Number of input channels. Default: 3
embed_dim (int): Number of linear projection output channels. Default: 96.
norm_layer (nn.Module, optional): Normal... | 3 | 2 | 16 | 1 | 15 | 2 | 2 | 0.37 | 1 | 3 | 0 | 0 | 2 | 3 | 2 | 12 | 43 | 4 | 30 | 14 | 21 | 11 | 18 | 8 | 15 | 2 | 1 | 1 | 4 |
18,492 | pytorch/vision | pytorch_vision/torchvision/models/video/swin_transformer.py | torchvision.models.video.swin_transformer.ShiftedWindowAttention3d | import torch.nn.functional as F
from torch import nn, Tensor
import torch
class ShiftedWindowAttention3d(nn.Module):
"""
See :func:`shifted_window_attention_3d`.
"""
def __init__(self, dim: int, window_size: list[int], shift_size: list[int], num_heads: int, qkv_bias: bool=True, proj_bias: bool=True, a... |
class ShiftedWindowAttention3d(nn.Module):
'''
See :func:`shifted_window_attention_3d`.
'''
def __init__(self, dim: int, window_size: list[int], shift_size: list[int], num_heads: int, qkv_bias: bool=True, proj_bias: bool=True, attention_dropout: float=0.0, dropout: float=0.0) -> None:
pass
... | 6 | 1 | 16 | 1 | 14 | 3 | 1 | 0.23 | 1 | 7 | 0 | 0 | 5 | 8 | 5 | 15 | 87 | 11 | 69 | 33 | 53 | 16 | 39 | 23 | 33 | 2 | 1 | 1 | 6 |
18,493 | pytorch/vision | pytorch_vision/torchvision/models/video/swin_transformer.py | torchvision.models.video.swin_transformer.Swin3D_B_Weights | from functools import partial
from .._api import register_model, Weights, WeightsEnum
from ...transforms._presets import VideoClassification
class Swin3D_B_Weights(WeightsEnum):
KINETICS400_V1 = Weights(url='https://download.pytorch.org/models/swin3d_b_1k-24f7c7c6.pth', transforms=partial(VideoClassification, crop... |
class Swin3D_B_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 56 | 0 | 56 | 4 | 55 | 2 | 4 | 4 | 3 | 0 | 5 | 0 | 0 |
18,494 | pytorch/vision | pytorch_vision/torchvision/models/video/swin_transformer.py | torchvision.models.video.swin_transformer.Swin3D_S_Weights | from ...transforms._presets import VideoClassification
from functools import partial
from .._api import register_model, Weights, WeightsEnum
class Swin3D_S_Weights(WeightsEnum):
KINETICS400_V1 = Weights(url='https://download.pytorch.org/models/swin3d_s-da41c237.pth', transforms=partial(VideoClassification, crop_si... |
class Swin3D_S_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 29 | 0 | 29 | 3 | 28 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,495 | pytorch/vision | pytorch_vision/torchvision/models/video/swin_transformer.py | torchvision.models.video.swin_transformer.Swin3D_T_Weights | from functools import partial
from .._api import register_model, Weights, WeightsEnum
from ...transforms._presets import VideoClassification
class Swin3D_T_Weights(WeightsEnum):
KINETICS400_V1 = Weights(url='https://download.pytorch.org/models/swin3d_t-7615ae03.pth', transforms=partial(VideoClassification, crop_si... |
class Swin3D_T_Weights(WeightsEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 29 | 0 | 29 | 3 | 28 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
18,496 | pytorch/vision | pytorch_vision/torchvision/models/video/swin_transformer.py | torchvision.models.video.swin_transformer.SwinTransformer3d | from functools import partial
from ...utils import _log_api_usage_once
from typing import Any, Callable, Optional
from ..swin_transformer import PatchMerging, SwinTransformerBlock
import torch
from torch import nn, Tensor
import torch.nn.functional as F
class SwinTransformer3d(nn.Module):
"""
Implements 3D Swi... |
class SwinTransformer3d(nn.Module):
'''
Implements 3D Swin Transformer from the `"Video Swin Transformer" <https://arxiv.org/abs/2106.13230>`_ paper.
Args:
patch_size (List[int]): Patch size.
embed_dim (int): Patch embedding dimension.
depths (List(int)): Depth of each Swin Transfor... | 3 | 1 | 43 | 4 | 37 | 4 | 6 | 0.35 | 1 | 10 | 4 | 0 | 2 | 8 | 2 | 12 | 107 | 9 | 75 | 36 | 56 | 26 | 46 | 20 | 43 | 11 | 1 | 3 | 12 |
18,497 | pytorch/vision | pytorch_vision/torchvision/models/vision_transformer.py | torchvision.models.vision_transformer.ConvStemConfig | import torch.nn as nn
from typing import Any, Callable, NamedTuple, Optional
class ConvStemConfig(NamedTuple):
out_channels: int
kernel_size: int
stride: int
norm_layer: Callable[..., nn.Module] = nn.BatchNorm2d
activation_layer: Callable[..., nn.Module] = nn.ReLU |
class ConvStemConfig(NamedTuple):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 | 6 | 3 | 5 | 0 | 6 | 3 | 5 | 0 | 1 | 0 | 0 |
18,498 | pytorch/vision | pytorch_vision/torchvision/models/vision_transformer.py | torchvision.models.vision_transformer.Encoder | from collections import OrderedDict
from functools import partial
from typing import Any, Callable, NamedTuple, Optional
import torch
import torch.nn as nn
class Encoder(nn.Module):
"""Transformer Model Encoder for sequence to sequence translation."""
def __init__(self, seq_length: int, num_layers: int, num_h... |
class Encoder(nn.Module):
'''Transformer Model Encoder for sequence to sequence translation.'''
def __init__(self, seq_length: int, num_layers: int, num_heads: int, hidden_dim: int, mlp_dim: int, dropout: float, attention_dropout: float, norm_layer: Callable[..., torch.nn.Module]=partial(nn.LayerNorm, eps=1e-... | 3 | 1 | 16 | 0 | 15 | 2 | 2 | 0.13 | 1 | 9 | 1 | 0 | 2 | 4 | 2 | 12 | 36 | 2 | 31 | 19 | 18 | 4 | 14 | 9 | 11 | 2 | 1 | 1 | 3 |
18,499 | pytorch/vision | pytorch_vision/torchvision/models/vision_transformer.py | torchvision.models.vision_transformer.EncoderBlock | import torch.nn as nn
from typing import Any, Callable, NamedTuple, Optional
from functools import partial
import torch
class EncoderBlock(nn.Module):
"""Transformer encoder block."""
def __init__(self, num_heads: int, hidden_dim: int, mlp_dim: int, dropout: float, attention_dropout: float, norm_layer: Callab... |
class EncoderBlock(nn.Module):
'''Transformer encoder block.'''
def __init__(self, num_heads: int, hidden_dim: int, mlp_dim: int, dropout: float, attention_dropout: float, norm_layer: Callable[..., torch.nn.Module]=partial(nn.LayerNorm, eps=1e-06)):
pass
def forward(self, input: torch.Tensor):
... | 3 | 1 | 15 | 2 | 13 | 1 | 1 | 0.12 | 1 | 6 | 1 | 0 | 2 | 6 | 2 | 12 | 34 | 5 | 26 | 20 | 15 | 3 | 18 | 12 | 15 | 1 | 1 | 0 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.