code: def add_arguments(
      cls, parser: argparse.ArgumentParser
  ) -> argparse.ArgumentParser:
      if cls != TextTransformer:
          return parser
      group = parser.add_argument_group(title=cls.__name__)
      group.add_argument(
          "--model.text.transformer.model-dim",
          type=int,
          default=512,
          help="Model dimension of the transformer model",
      )
  
      group.add_argument(
          "--model.text.transformer.no-scale-embedding",
          action="store_true",
          help="Do not scale the output of embedding layer in {}".format(
              cls.__name__
          ),
      )
  
      group.add_argument(
          "--model.text.transformer.no-pos-embedding",
          action="store_true",
          help="Do not add positional embeddings to the output of embedding layer in {}".format(
              cls.__name__
          ),
      )
  
      group.add_argument(
          "--model.text.transformer.embed-dropout",
          type=float,
          default=0.0,
          help="Dropout in embedding layer",
      )
  
      # transformer layer parameters
      default_layers = 6
      group.add_argument(
          "--model.text.transformer.n-transformer-layers",
          type=int,
          default=default_layers,
          help="Number of transformer layers in {}".format(
              cls.__name__
          ),
      )
      group.add_argument(
          "--model.text.transformer.n-heads-per-layer",
          type=int,
          default=[8] * default_layers,
          nargs="+",
          help="Number of transformer heads per transformer layer",
      )
  
      group.add_argument(
          "--model.text.transformer.ffn-multiplier-per-layer",
          type=float,
          default=[4.0] * default_layers,
          nargs="+",
          help="FFN multiplier for each transformer layer",
      )
      group.add_argument(
          "--model.text.transformer.attn-dropout",
          type=float,
          default=0.0,
          help="Dropout in multi-head attention",
      )
      group.add_argument(
          "--model.text.transformer.ffn-dropout",
          type=float,
          default=0.0,
          help="Dropout between linear layers in FFN",
      )
      group.add_argument(
          "--model.text.transformer.dropout",
          type=float,
          default=0.0,
          help="Dropout in transformer",
      )
  
      group.add_argument(
          "--model.text.transformer.norm-layer",
          type=str,
          default="layer_norm",
          help="Normalization layer",
      )
  
      group.add_argument(
          "--model.text.transformer.sinusoidal-pos-emb",
          action="store_true",
          help="Use sinusoidal positional embedding",
      )
  
      group.add_argument(
          "--model.text.transformer.gradient-checkpoint",
          action="store_true",
          help="Use gradient checkpointing",
      )
      group.add_argument(
          "--model.text.transformer.num-checkpoint-segments",
          type=int,
          default=1,
          help="Number of gradient checkpoint segments",
      )
  
      group.add_argument(
          "--model.text.transformer.causal-masking",
          action="store_true",
          help="Use causal masking",
      )
  
      group.add_argument(
          "--model.text.transformer.classes-per-split-zero-shot",
          type=int,
          default=20,
          help="Divide zero-shot classes into these many chunks, for faster processing",
      )
  
      return parser
  
imports: import argparse
  import math
  from typing import Optional, Sequence
  import torch
  from torch import Tensor, nn
  from torch.nn import functional
  from torch.utils.checkpoint import checkpoint
  from cvnets.layers import Dropout, Embedding, PositionalEmbedding, get_normalization_layer
  from cvnets.modules import TransformerEncoder
  from cvnets.text_encoders import TEXT_ENCODER_REGISTRY, BaseTextEncoder
  from utils import logger
label_desc: Use image node_id 3 for calling the TextTransformer obj's underlying member method code with example usage: obj.add_arguments(cls, parser) and returns: parser, parser