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 outputs for output
  
  Args:
      mel_specgram (Tensor): mel spectrogram with shape (max of ``mel_specgram_lengths``, n_batch, ``n_mels``)
      gate_outputs (Tensor): predicted stop token with shape (max of ``mel_specgram_lengths``, n_batch)
      alignments (Tensor): sequence of attention weights from the decoder
          with shape (max of ``mel_specgram_lengths``, n_batch, max of ``text_lengths``)
  
  Returns:
      mel_specgram (Tensor): mel spectrogram with shape (n_batch, ``n_mels``, max of ``mel_specgram_lengths``)
      gate_outputs (Tensor): predicted stop token with shape (n_batch, max of ``mel_specgram_lengths``)
      alignments (Tensor): sequence of attention weights from the decoder
          with shape (n_batch, max of ``mel_specgram_lengths``, max of ``text_lengths``)
docstr_tok: ["Prepares","decoder","outputs","for","output","Args",":","mel_specgram","(","Tensor",")",":","mel","spectrogram","with","shape","(","max","of","``","mel_specgram_lengths","``",",","n_batch",",","``","n_mels","``",")","gate_outputs","(","Tensor",")",":","predicted","stop","token","with","shape","(","max","of","``","mel_specgram_lengths","``",",","n_batch",")","alignments","(","Tensor",")",":","sequence","of","attention","weights","from","the","decoder","with","shape","(","max","of","``","mel_specgram_lengths","``",",","n_batch",",","max","of","``","text_lengths","``",")","Returns",":","mel_specgram","(","Tensor",")",":","mel","spectrogram","with","shape","(","n_batch",",","``","n_mels","``",",","max","of","``","mel_specgram_lengths","``",")","gate_outputs","(","Tensor",")",":","predicted","stop","token","with","shape","(","n_batch",",","max","of","``","mel_specgram_lengths","``",")","alignments","(","Tensor",")",":","sequence","of","attention","weights","from","the","decoder","with","shape","(","n_batch",",","max","of","``","mel_specgram_lengths","``",",","max","of","``","text_lengths","``",")"]
code: def _parse_decoder_outputs(
      self,
      mel_specgram: Tensor,
      gate_outputs: Tensor,
      alignments: Tensor,
  ) -> Tuple[Tensor, Tensor, Tensor]:
      r"""Prepares decoder outputs for output
  
      Args:
          mel_specgram (Tensor): mel spectrogram with shape (max of ``mel_specgram_lengths``, n_batch, ``n_mels``)
          gate_outputs (Tensor): predicted stop token with shape (max of ``mel_specgram_lengths``, n_batch)
          alignments (Tensor): sequence of attention weights from the decoder
              with shape (max of ``mel_specgram_lengths``, n_batch, max of ``text_lengths``)
  
      Returns:
          mel_specgram (Tensor): mel spectrogram with shape (n_batch, ``n_mels``, max of ``mel_specgram_lengths``)
          gate_outputs (Tensor): predicted stop token with shape (n_batch, max of ``mel_specgram_lengths``)
          alignments (Tensor): sequence of attention weights from the decoder
              with shape (n_batch, max of ``mel_specgram_lengths``, max of ``text_lengths``)
      """
      # (mel_specgram_lengths.max(), n_batch, text_lengths.max())
      # -> (n_batch, mel_specgram_lengths.max(), text_lengths.max())
      alignments = alignments.transpose(0, 1).contiguous()
      # (mel_specgram_lengths.max(), n_batch) -> (n_batch, mel_specgram_lengths.max())
      gate_outputs = gate_outputs.transpose(0, 1).contiguous()
      # (mel_specgram_lengths.max(), n_batch, n_mels) -> (n_batch, mel_specgram_lengths.max(), n_mels)
      mel_specgram = mel_specgram.transpose(0, 1).contiguous()
      # decouple frames per step
      shape = (mel_specgram.shape[0], -1, self.n_mels)
      mel_specgram = mel_specgram.view(*shape)
      # (n_batch, mel_specgram_lengths.max(), n_mels) -> (n_batch, n_mels, T_out)
      mel_specgram = mel_specgram.transpose(1, 2)
  
      return mel_specgram, gate_outputs, alignments
  
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 5 for calling the _Decoder obj's underlying member method code with example usage: obj._parse_decoder_outputs(mel_specgram, gate_outputs, alignments) and returns: mel_specgram,  gate_outputs,  alignments