class_docstr: Swin Transformer Block.
  
  Args:
      dim (int): Number of input channels.
      input_resolution (tuple[int]): Input resulotion.
      num_heads (int): Number of attention heads.
      window_size (int): Window size.
      shift_size (int): Shift size for SW-MSA.
      mlp_ratio (float): Ratio of mlp hidden dim to embedding dim.
      qkv_bias (bool, optional): If True, add a learnable bias to query, key, value. Default: True
      qk_scale (float | None, optional): Override default qk scale of head_dim ** -0.5 if set.
      drop (float, optional): Dropout rate. Default: 0.0
      attn_drop (float, optional): Attention dropout rate. Default: 0.0
      drop_path (float, optional): Stochastic depth rate. Default: 0.0
      act_layer (nn.Module, optional): Activation layer. Default: nn.GELU
      norm_layer (nn.Module, optional): Normalization layer.  Default: nn.LayerNorm
code: def flops(self):
      flops = 0
      H, W = self.input_resolution
      # norm1
      flops += self.dim * H * W
      # W-MSA/SW-MSA
      nW = H * W / self.window_size / self.window_size
      flops += nW * self.attn.flops(self.window_size * self.window_size)
      # mlp
      flops += 2 * H * W * self.dim * self.dim * self.mlp_ratio
      # norm2
      flops += self.dim * H * W
      return flops
  
imports: from typing import List, Optional
  import torch
  import torch.nn
  import torch.utils.checkpoint
  from vissl.config import AttrDict
  from vissl.models.model_helpers import DropPath, to_2tuple, trunc_normal_
  from vissl.models.trunks import register_model_trunk
label_desc: Use image node_id 4 for calling the SwinTransformerBlock obj's underlying member method code with example usage: obj.flops() and returns: flops