docstr: Getting the logits. This can be used for language modeling.
  
  Parameters
  ----------
  inputs
      - layout = 'NT'
          Shape (batch_size, seq_length)
      - layout = 'TN'
          Shape (seq_length, batch_size)
  
  states
      The states.
  
      - layout = 'NT'
          Shape (num_layers, 2, batch_size, prev_len, C_in)
      - layout = 'TN'
          Shape (num_layers, 2, prev_len, batch_size, C_in)
  
  Returns
  -------
  logits
      - layout = 'NT'
          Shape (batch_size, seq_length, vocab_size).
      - layout = 'TN'
          Shape (seq_length, batch_size, vocab_size).
  
  new_states
      - layout = 'NT'
          Shape (num_layers, 2, batch_size, prev_len + seq_length, C_in)
      - layout = 'TN'
          Shape (num_layers, 2, prev_len + seq_length, batch_size, C_in)
docstr_tok: ["Getting","the","logits",".","This","can","be","used","for","language","modeling",".","Parameters","--","--","--","--","--","inputs","-","layout","=","'NT'","Shape","(","batch_size",",","seq_length",")","-","layout","=","'TN'","Shape","(","seq_length",",","batch_size",")","states","The","states",".","-","layout","=","'NT'","Shape","(","num_layers",",","2",",","batch_size",",","prev_len",",","C_in",")","-","layout","=","'TN'","Shape","(","num_layers",",","2",",","prev_len",",","batch_size",",","C_in",")","Returns","--","--","--","-","logits","-","layout","=","'NT'","Shape","(","batch_size",",","seq_length",",","vocab_size",")",".","-","layout","=","'TN'","Shape","(","seq_length",",","batch_size",",","vocab_size",")",".","new_states","-","layout","=","'NT'","Shape","(","num_layers",",","2",",","batch_size",",","prev_len","+","seq_length",",","C_in",")","-","layout","=","'TN'","Shape","(","num_layers",",","2",",","prev_len","+","seq_length",",","batch_size",",","C_in",")"]
code: def forward(self, inputs, states):
      """Getting the logits. This can be used for language modeling.
  
      Parameters
      ----------
      inputs
          - layout = 'NT'
              Shape (batch_size, seq_length)
          - layout = 'TN'
              Shape (seq_length, batch_size)
  
      states
          The states.
  
          - layout = 'NT'
              Shape (num_layers, 2, batch_size, prev_len, C_in)
          - layout = 'TN'
              Shape (num_layers, 2, prev_len, batch_size, C_in)
  
      Returns
      -------
      logits
          - layout = 'NT'
              Shape (batch_size, seq_length, vocab_size).
          - layout = 'TN'
              Shape (seq_length, batch_size, vocab_size).
  
      new_states
          - layout = 'NT'
              Shape (num_layers, 2, batch_size, prev_len + seq_length, C_in)
          - layout = 'TN'
              Shape (num_layers, 2, prev_len + seq_length, batch_size, C_in)
  
      """
      contextual_embeddings, new_states = self._backbone_model(
          inputs, states
      )
      logits = self._lm_head(contextual_embeddings)
      return logits, new_states
  
imports: import os
  from typing import Tuple
  import mxnet
  from mxnet import use_np, np, npx
  from mxnet.gluon import HybridBlock, nn
  from .base import BACKBONE_REGISTRY
  from ..base import get_model_zoo_home_dir, get_repo_model_zoo_url, get_model_zoo_checksum_dir
  from ..utils.config import CfgNode
  from ..utils.misc import load_checksum_stats, download
  from ..utils.registry import Registry
  from ..initializer import TruncNorm
  from ..attention_cell import MultiHeadAttentionCell
  from ..layers import get_activation, PositionalEmbedding
  from ..data.tokenizers import HuggingFaceByteBPETokenizer
label_desc: Use image node_id 2 for calling the GPT2ForLM obj's underlying member method code with example usage: obj.forward(inputs, states) and returns: logits,  new_states