MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / __init__

Method __init__

models/aios/backbones/swin_transformer.py:457–476  ·  view source on GitHub ↗
(self,
                 patch_size=4,
                 in_chans=3,
                 embed_dim=96,
                 norm_layer=None)

Source from the content-addressed store, hash-verified

455 norm_layer (nn.Module, optional): Normalization layer. Default: None
456 """
457 def __init__(self,
458 patch_size=4,
459 in_chans=3,
460 embed_dim=96,
461 norm_layer=None):
462 super().__init__()
463 patch_size = to_2tuple(patch_size)
464 self.patch_size = patch_size
465
466 self.in_chans = in_chans
467 self.embed_dim = embed_dim
468
469 self.proj = nn.Conv2d(in_chans,
470 embed_dim,
471 kernel_size=patch_size,
472 stride=patch_size)
473 if norm_layer is not None:
474 self.norm = norm_layer(embed_dim)
475 else:
476 self.norm = None
477
478 def forward(self, x):
479 """Forward function."""

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected