class_docstr: Transformer language model.
class_docstr_tok: ["Transformer","language","model","."]
docstr: Add arguments to command line argument parser.
docstr_tok: ["Add","arguments","to","command","line","argument","parser","."]
code: def add_arguments(parser):
      """Add arguments to command line argument parser."""
      parser.add_argument(
          "--layer", type=int, default=4, help="Number of hidden layers"
      )
      parser.add_argument(
          "--unit",
          type=int,
          default=1024,
          help="Number of hidden units in feedforward layer",
      )
      parser.add_argument(
          "--att-unit",
          type=int,
          default=256,
          help="Number of hidden units in attention layer",
      )
      parser.add_argument(
          "--embed-unit",
          type=int,
          default=128,
          help="Number of hidden units in embedding layer",
      )
      parser.add_argument(
          "--head",
          type=int,
          default=2,
          help="Number of multi head attention",
      )
      parser.add_argument(
          "--dropout-rate",
          type=float,
          default=0.5,
          help="dropout probability",
      )
      parser.add_argument(
          "--att-dropout-rate",
          type=float,
          default=0.0,
          help="att dropout probability",
      )
      parser.add_argument(
          "--emb-dropout-rate",
          type=float,
          default=0.0,
          help="emb dropout probability",
      )
      parser.add_argument(
          "--tie-weights",
          type=strtobool,
          default=False,
          help="Tie input and output embeddings",
      )
      parser.add_argument(
          "--pos-enc",
          default="sinusoidal",
          choices=["sinusoidal", "none"],
          help="positional encoding",
      )
      return parser
  
imports: import logging
  from typing import Any, List, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from espnet.nets.lm_interface import LMInterface
  from espnet.nets.pytorch_backend.transformer.embedding import PositionalEncoding
  from espnet.nets.pytorch_backend.transformer.encoder import Encoder
  from espnet.nets.pytorch_backend.transformer.mask import subsequent_mask
  from espnet.nets.scorer_interface import BatchScorerInterface
  from espnet.utils.cli_utils import strtobool
label_desc: Use image node_id 1 for calling the TransformerLM obj's underlying member method code with example usage: obj.add_arguments(parser) and returns: parser