class_docstr: Implements Swin Transformer from the `"Swin Transformer: Hierarchical Vision Transformer using
  Shifted Windows" <https://arxiv.org/pdf/2103.14030>`_ paper.
  
  The code is adapted from `"Torchvision repository" <https://github.com/pytorch/vision/blob/main/torchvision/models/swin_transformer.py>`_
class_docstr_tok: ["Implements","Swin","Transformer","from","the","`","``","Swin","Transformer",":","Hierarchical","Vision","Transformer","using","Shifted","Windows","''","<","https",":","\/\/arxiv.org\/pdf\/2103.14030",">","`","_","paper",".","The","code","is","adapted","from","`","``","Torchvision","repository","''","<","https",":","\/\/github.com\/pytorch\/vision\/blob\/main\/torchvision\/models\/swin_transformer.py",">","`","_"]
code: def add_arguments(
      cls, parser: argparse.ArgumentParser
  ) -> argparse.ArgumentParser:
      group = parser.add_argument_group(title=cls.__name__)
      group.add_argument(
          "--model.classification.swin.mode",
          type=str,
          default="tiny",
          help="SwinTransformer mode. Default is swin_t",
      )
  
      group.add_argument(
          "--model.classification.swin.stochastic-depth-prob",
          type=float,
          default=None,
      )
  
      group.add_argument(
          "--model.classification.swin.extract-end-point-format",
          type=str,
          default="nchw",
          choices=["nchw", "nhwc"],
          help="End point extraction format in Swin Transformer. This is useful for down-stream tasks where "
          "task-specific heads are either in nhwc format or nchw format. Defaults to nchw.",
      )
  
      return parser
  
file_path: ml-cvnets/cvnets/models/classification/swin_transformer.py
imports: import argparse
  from typing import Dict, List, Optional
  import torch
  from torch import Tensor, nn
  from cvnets.layers import ConvLayer2d, Dropout, GlobalPool, Identity, LinearLayer, get_normalization_layer
  from cvnets.models import MODEL_REGISTRY
  from cvnets.models.classification.base_image_encoder import BaseImageEncoder
  from cvnets.models.classification.config.swin_transformer import get_configuration
  from cvnets.modules import PatchMerging, Permute, SwinTransformerBlock
  from utils import logger
label_desc: Use image node_id 3 for calling the SwinTransformer obj's underlying member method code with example usage: obj.add_arguments(cls, parser) and returns: parser