code: def __init__(
      self,
      d_model,
      copy_attn,
      embeddings,
      alignment_layer,
      layer_norm,
      norm_eps,
  ):
      super(TransformerDecoderBase, self).__init__()
  
      self.embeddings = embeddings
  
      # Decoder State
      self.state = {}
  
      # previously, there was a GlobalAttention module here for copy
      # attention. But it was never actually used -- the "copy" attention
      # just reuses the context attention.
      self._copy = copy_attn
      if layer_norm == "standard":
          self.layer_norm = nn.LayerNorm(d_model, eps=norm_eps)
      elif layer_norm == "rms":
          self.layer_norm = RMSNorm(d_model, eps=norm_eps)
      else:
          raise ValueError(
              f"{layer_norm} layer norm type is not supported"
          )
  
      self.alignment_layer = alignment_layer
  
imports: import torch
  import torch.nn
  from onmt.decoders.decoder import DecoderBase
  from onmt.modules import MultiHeadedAttention, AverageAttention
  from onmt.modules.position_ffn import PositionwiseFeedForward
  from onmt.modules.position_ffn import ActivationFunction
  from onmt.modules.moe import MoE
  from onmt.utils.misc import sequence_mask
  from onmt.modules.rmsnorm import RMSNorm
label_desc: Use image node_id 1 to create a new TransformerDecoderBase object from inherited base classes: DecoderBase with example: obj = TransformerDecoderBase(d_model, copy_attn, embeddings, alignment_layer, layer_norm, norm_eps)