class_docstr: Combines decoder_embedding with the tokens_head layer to simulate the classifier in NemoNMT
class_docstr_tok: ["Combines","decoder_embedding","with","the","tokens_head","layer","to","simulate","the","classifier","in","NemoNMT"]
code: def forward(self, dec_output):
      if isinstance(dec_output, list):
          dec_output = dec_output[0]
  
      if self.tokens_head_bias is not None:
          return F.linear(
              dec_output,
              self.decoder_embedding.word_embeddings.weight,
              self.tokens_head_bias,
          ).float()
      return F.linear(
          dec_output, self.decoder_embedding.word_embeddings.weight
      ).float()
  
imports: import random
  from typing import Dict, List, Optional
  import torch
  import torch.nn.functional
  from nemo.collections.nlp.modules.common.megatron.utils import build_position_ids
  from nemo.core.classes.exportable import Exportable
  from nemo.core.neural_types import ChannelType, EncodedRepresentation, MaskType, NeuralType
label_desc: Use image node_id 4 for calling the TokensHeadEmb obj's underlying member method code with example usage: obj.forward(dec_output) and returns: F, F