class_docstr: Transformer decoder consisting of *config.decoder_layers* layers. Each layer is a [`WhisperDecoderLayer`]
  
  Args:
      config: WhisperConfig
class_docstr_tok: ["Transformer","decoder","consisting","of","*","config.decoder_layers","*","layers",".","Each","layer","is","a","[","`","WhisperDecoderLayer","`","]","Args",":","config",":","WhisperConfig"]
code: def __init__(self, config: WhisperConfig):
      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.max_source_positions = config.max_source_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 = WhisperPositionalEmbedding(
          self.max_target_positions, config.d_model
      )
  
      self.layers = nn.ModuleList(
          [
              WhisperDecoderLayer(config)
              for _ in range(config.decoder_layers)
          ]
      )
  
      self.layer_norm = nn.LayerNorm(config.d_model)
  
      self.gradient_checkpointing = False
      # Initialize weights and apply final processing
      self.post_init()
  
imports: import math
  import random
  from typing import Optional, Tuple
  import torch
  import torch.utils.checkpoint
  from torch import nn
  from torch.nn import CrossEntropyLoss
  from ...activations import ACT2FN
  from ...modeling_outputs import BaseModelOutput, BaseModelOutputWithPastAndCrossAttentions, Seq2SeqLMOutput, Seq2SeqModelOutput
  from ...modeling_utils import PreTrainedModel
  from ...utils import add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
  from .configuration_whisper import WhisperConfig
label_desc: Use image node_id 1 to create a new WhisperDecoder object from inherited base classes: WhisperPreTrainedModel with example: obj = WhisperDecoder(config)