class_docstr: Left-to-right Transformer language model.
docstr: No special modification required for Lightning, define it as you normally would
  in the `nn.Module` in vanilla PyTorch.
docstr_tok: ["No","special","modification","required","for","Lightning",",","define","it","as","you","normally","would","in","the","`","nn.Module","`","in","vanilla","PyTorch","."]
code: def forward(self, input_ids, attention_mask):
      """
      No special modification required for Lightning, define it as you normally would
      in the `nn.Module` in vanilla PyTorch.
      """
  
      hidden_states = self.encoder(
          input_ids=input_ids, encoder_mask=attention_mask
      )
      log_probs = self.log_softmax(hidden_states=hidden_states)
  
      return log_probs
  
imports: import json
  import math
  from typing import Dict, Optional
  import numpy
  import torch
  import torch.utils.data
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import Trainer
  from nemo.collections.common.losses import SmoothedCrossEntropyLoss
  from nemo.collections.common.metrics import GlobalAverageLossMetric
  from nemo.collections.common.parts import transformer_weights_init
  from nemo.collections.nlp.data import SentenceDataset, TarredSentenceDataset
  from nemo.collections.nlp.metrics import SequencePerplexity
  from nemo.collections.nlp.modules.common import TokenClassifier
  from nemo.collections.nlp.modules.common.lm_utils import get_transformer
  from nemo.collections.nlp.modules.common.tokenizer_utils import get_tokenizer
  from nemo.core.classes.common import typecheck
  from nemo.core.classes.modelPT import ModelPT
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 2 for calling the TransformerLMModel obj's underlying member method code with example usage: obj.forward(input_ids, attention_mask) and returns: log_probs