Patch Overlap

class vformer.encoder.embedding.overlappatch.OverlapPatchEmbed(img_size, patch_size, stride=4, in_channels=3, embedding_dim=768, norm_layer=<class 'torch.nn.modules.normalization.LayerNorm'>)[source]
Parameters
  • img_size (int) – Image Size

  • patch_size (int or tuple(int)) – Patch Size

  • stride (int) – Stride of the convolution, default is 4

  • in_channels (int) – Number of input channels in the image, default is 3

  • embedding_dim (int) – Number of linear projection output channels,default is 768

  • norm_layer (nn.Module, optional) – Normalization layer, default is nn.LayerNorm

forward(x)[source]
Parameters

x (torch.Tensor) – Input tensor

Returns

  • x (torch.Tensor) – Input tensor

  • H (int) – Height of Patch

  • W (int) – Width of Patch