class_docstr: 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 (float): Ratio of mlp hidden dim to embedding dim. Default: 4.0.
      dropout (float): Dropout rate. Default: 0.0.
      attention_dropout (float): Attention dropout rate. Default: 0.0.
      stochastic_depth_prob: (float): Stochastic depth rate. Default: 0.0.
      norm_layer (nn.Module): Normalization layer.  Default: nn.LayerNorm.
      attn_layer (nn.Module): Attention layer. Default: ShiftedWindowAttention
class_docstr_tok: ["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","(","float",")",":","Ratio","of","mlp","hidden","dim","to","embedding","dim",".","Default",":","4.0.","dropout","(","float",")",":","Dropout","rate",".","Default",":","0.0.","attention_dropout","(","float",")",":","Attention","dropout","rate",".","Default",":","0.0.","stochastic_depth_prob",":","(","float",")",":","Stochastic","depth","rate",".","Default",":","0.0.","norm_layer","(","nn.Module",")",":","Normalization","layer",".","Default",":","nn.LayerNorm",".","attn_layer","(","nn.Module",")",":","Attention","layer",".","Default",":","ShiftedWindowAttention"]
code: def __repr__(self) -> str:
      return "{}(embed_dim={}, ffn_dim={}, dropout={}, ffn_dropout={}, attn_fn={}, act_fn={}, norm_fn={})".format(
          self.__class__.__name__,
          self.embed_dim,
          self.ffn_dim,
          self.std_dropout,
          self.ffn_dropout,
          self.attn_fn_name,
          self.act_fn_name,
          self.norm_type,
      )
  
imports: from typing import List, Optional
  import torch
  from torch import Tensor, nn
  from torch.nn import functional
  from cvnets.layers import Dropout, LinearLayer, StochasticDepth, get_normalization_layer
  from cvnets.layers.activation import build_activation_layer
  from cvnets.modules import BaseModule
label_desc: Use image node_id 2 for calling the SwinTransformerBlock obj's underlying member method code with example usage: obj.__repr__() and returns: str