class_docstr: Transformer decoder consisting of *config.decoder_layers* layers. Each layer is a [`Speech2Text2DecoderLayer`]
  
  Args:
      config: Speech2Text2Config
      embed_tokens (nn.Embedding): output embedding
code: def __init__(self, config: Speech2Text2Config):
      super().__init__(config)
      self.dropout = config.dropout
      self.layerdrop = config.decoder_layerdrop
      self.padding_idx = config.pad_token_id
      self.max_target_positions = config.max_target_positions
      self.embed_scale = (
          math.sqrt(config.d_model) if config.scale_embedding else 1.0
      )
  
      self.embed_tokens = nn.Embedding(
          config.vocab_size, config.d_model, self.padding_idx
      )
  
      self.embed_positions = Speech2Text2SinusoidalPositionalEmbedding(
          self.max_target_positions,
          config.d_model,
          self.padding_idx,
      )
  
      self.layers = nn.ModuleList(
          [
              Speech2Text2DecoderLayer(config)
              for _ in range(config.decoder_layers)
          ]
      )
  
      self.gradient_checkpointing = False
      # Initialize weights and apply final processing
      self.post_init()
  
imports: import copy
  import math
  from typing import Optional, Tuple, Union
  import torch
  from torch import nn
  from torch.nn import CrossEntropyLoss
  from ...activations import ACT2FN
  from ...modeling_attn_mask_utils import _prepare_4d_attention_mask, _prepare_4d_causal_attention_mask
  from ...modeling_outputs import BaseModelOutputWithPastAndCrossAttentions, CausalLMOutputWithCrossAttentions
  from ...modeling_utils import PreTrainedModel
  from ...utils import add_start_docstrings, logging, replace_return_docstrings
  from .configuration_speech_to_text_2 import Speech2Text2Config
label_desc: Use image node_id 1 to create a new Speech2Text2Decoder object from inherited base classes: Speech2Text2PreTrainedModel with example: obj = Speech2Text2Decoder(config)