class_docstr: Decoder with Attention model.
  
  Args:
      n_mels (int): number of mel bins
      n_frames_per_step (int): number of frames processed per step, only 1 is supported
      encoder_embedding_dim (int): the number of embedding dimensions in the encoder.
      decoder_rnn_dim (int): number of units in decoder LSTM
      decoder_max_step (int): maximum number of output mel spectrograms
      decoder_dropout (float): dropout probability for decoder LSTM
      decoder_early_stopping (bool): stop decoding when all samples are finished
      attention_rnn_dim (int): number of units in attention LSTM
      attention_hidden_dim (int): dimension of attention hidden representation
      attention_location_n_filter (int): number of filters for attention model
      attention_location_kernel_size (int): kernel size for attention model
      attention_dropout (float): dropout probability for attention LSTM
      prenet_dim (int): number of ReLU units in prenet layers
      gate_threshold (float): probability threshold for stop token
class_docstr_tok: ["Decoder","with","Attention","model",".","Args",":","n_mels","(","int",")",":","number","of","mel","bins","n_frames_per_step","(","int",")",":","number","of","frames","processed","per","step",",","only","1","is","supported","encoder_embedding_dim","(","int",")",":","the","number","of","embedding","dimensions","in","the","encoder",".","decoder_rnn_dim","(","int",")",":","number","of","units","in","decoder","LSTM","decoder_max_step","(","int",")",":","maximum","number","of","output","mel","spectrograms","decoder_dropout","(","float",")",":","dropout","probability","for","decoder","LSTM","decoder_early_stopping","(","bool",")",":","stop","decoding","when","all","samples","are","finished","attention_rnn_dim","(","int",")",":","number","of","units","in","attention","LSTM","attention_hidden_dim","(","int",")",":","dimension","of","attention","hidden","representation","attention_location_n_filter","(","int",")",":","number","of","filters","for","attention","model","attention_location_kernel_size","(","int",")",":","kernel","size","for","attention","model","attention_dropout","(","float",")",":","dropout","probability","for","attention","LSTM","prenet_dim","(","int",")",":","number","of","ReLU","units","in","prenet","layers","gate_threshold","(","float",")",":","probability","threshold","for","stop","token"]
docstr: Prepares decoder inputs.
  
  Args:
      decoder_inputs (Tensor): Inputs used for teacher-forced training, i.e. mel-specs,
          with shape (n_batch, ``n_mels``, max of ``mel_specgram_lengths``)
  
  Returns:
      inputs (Tensor): Processed decoder inputs with shape (max of ``mel_specgram_lengths``, n_batch, ``n_mels``).
docstr_tok: ["Prepares","decoder","inputs",".","Args",":","decoder_inputs","(","Tensor",")",":","Inputs","used","for","teacher-forced","training",",","i.e",".","mel-specs",",","with","shape","(","n_batch",",","``","n_mels","``",",","max","of","``","mel_specgram_lengths","``",")","Returns",":","inputs","(","Tensor",")",":","Processed","decoder","inputs","with","shape","(","max","of","``","mel_specgram_lengths","``",",","n_batch",",","``","n_mels","``",")","."]
code: def _parse_decoder_inputs(self, decoder_inputs: Tensor) -> Tensor:
      r"""Prepares decoder inputs.
  
      Args:
          decoder_inputs (Tensor): Inputs used for teacher-forced training, i.e. mel-specs,
              with shape (n_batch, ``n_mels``, max of ``mel_specgram_lengths``)
  
      Returns:
          inputs (Tensor): Processed decoder inputs with shape (max of ``mel_specgram_lengths``, n_batch, ``n_mels``).
      """
      # (n_batch, n_mels, mel_specgram_lengths.max()) -> (n_batch, mel_specgram_lengths.max(), n_mels)
      decoder_inputs = decoder_inputs.transpose(1, 2)
      decoder_inputs = decoder_inputs.view(
          decoder_inputs.size(0),
          int(decoder_inputs.size(1) / self.n_frames_per_step),
          -1,
      )
      # (n_batch, mel_specgram_lengths.max(), n_mels) -> (mel_specgram_lengths.max(), n_batch, n_mels)
      decoder_inputs = decoder_inputs.transpose(0, 1)
      return decoder_inputs
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  from torch import nn, Tensor
  from torch.nn import functional
label_desc: Use image node_id 4 for calling the _Decoder obj's underlying member method code with example usage: obj._parse_decoder_inputs(decoder_inputs) and returns: decoder_inputs