code: def __init__(
      self,
      vocab_size: int,
      hidden_size: int,
      num_layers: int,
      inner_size: int,
      num_attention_heads: int,
      max_sequence_length: int = 512,
      num_token_types: int = 2,
      embedding_dropout: float = 0.0,
      learn_positional_encodings: bool = False,
      ffn_dropout: float = 0.0,
      attn_score_dropout: float = 0.0,
      attn_layer_dropout: float = 0.0,
      hidden_act: str = "relu",
      pre_ln: bool = False,
      pre_ln_final_layer_norm: bool = True,
  ):
      super().__init__()
  
      self._vocab_size = vocab_size
      self._hidden_size = hidden_size
      self._max_sequence_length = max_sequence_length
      self.num_states = num_layers + 1
      self.return_mems = False
      if pre_ln_final_layer_norm:
          self.num_states += 1
  
      self._embedding = TransformerEmbedding(
          vocab_size=self.vocab_size,
          hidden_size=self.hidden_size,
          max_sequence_length=max_sequence_length,
          num_token_types=num_token_types,
          embedding_dropout=embedding_dropout,
          learn_positional_encodings=learn_positional_encodings,
      )
  
      self._decoder = TransformerDecoder(
          hidden_size=self.hidden_size,
          num_layers=num_layers,
          inner_size=inner_size,
          num_attention_heads=num_attention_heads,
          ffn_dropout=ffn_dropout,
          attn_score_dropout=attn_score_dropout,
          attn_layer_dropout=attn_layer_dropout,
          hidden_act=hidden_act,
          pre_ln=pre_ln,
          pre_ln_final_layer_norm=pre_ln_final_layer_norm,
      )
  
imports: from dataclasses import dataclass
  from typing import Dict, Optional
  import torch
  from omegaconf.omegaconf import MISSING
  from nemo.collections.asr.modules.transformer.decoder_module import DecoderModule
  from nemo.collections.asr.modules.transformer.encoder_module import EncoderModule
  from nemo.collections.asr.modules.transformer.transformer_decoders import TransformerDecoder
  from nemo.collections.asr.modules.transformer.transformer_encoders import TransformerEncoder
  from nemo.collections.asr.modules.transformer.transformer_modules import TransformerEmbedding
  from nemo.core.classes.common import typecheck
  from nemo.core.classes.exportable import Exportable
  from nemo.core.neural_types import ChannelType, NeuralType
label_desc: Use image node_id 1 to create a new TransformerDecoderNM object from inherited base classes: DecoderModule, Exportable with example: obj = TransformerDecoderNM(vocab_size, hidden_size, num_layers, inner_size, num_attention_heads, max_sequence_length, num_token_types, embedding_dropout, learn_positional_encodings, ffn_dropout, attn_score_dropout, attn_layer_dropout, hidden_act, pre_ln, pre_ln_final_layer_norm)