class_docstr: Tacotron2 decoder. We don't use Zoneout but Dropout between RNN layers.
  
  Args:
      in_channels (int): number of input channels.
      frame_channels (int): number of feature frame channels.
      r (int): number of outputs per time step (reduction rate).
      memory_size (int): size of the past window. if <= 0 memory_size = r
      attn_type (string): type of attention used in decoder.
      attn_win (bool): if true, define an attention window centered to maximum
          attention response. It provides more robust attention alignment especially
          at interence time.
      attn_norm (string): attention normalization function. 'sigmoid' or 'softmax'.
      prenet_type (string): 'original' or 'bn'.
      prenet_dropout (float): prenet dropout rate.
      forward_attn (bool): if true, use forward attention method. https://arxiv.org/abs/1807.06736
      trans_agent (bool): if true, use transition agent. https://arxiv.org/abs/1807.06736
      forward_attn_mask (bool): if true, mask attention values smaller than a threshold.
      location_attn (bool): if true, use location sensitive attention.
      attn_K (int): number of attention heads for GravesAttention.
      separate_stopnet (bool): if true, detach stopnet input to prevent gradient flow.
docstr: shapes:
     - memory: B x r * self.frame_channels
docstr_tok: ["shapes",":","-","memory",":","B","x","r","*","self.frame_channels"]
code: def decode(self, memory):
      """
      shapes:
         - memory: B x r * self.frame_channels
      """
      # self.context: B x D_en
      # query_input: B x D_en + (r * self.frame_channels)
      query_input = torch.cat((memory, self.context), -1)
      # self.query and self.attention_rnn_cell_state : B x D_attn_rnn
      self.query, self.attention_rnn_cell_state = self.attention_rnn(
          query_input, (self.query, self.attention_rnn_cell_state)
      )
      self.query = F.dropout(
          self.query, self.p_attention_dropout, self.training
      )
      self.attention_rnn_cell_state = F.dropout(
          self.attention_rnn_cell_state,
          self.p_attention_dropout,
          self.training,
      )
      # B x D_en
      self.context = self.attention(
          self.query, self.inputs, self.processed_inputs, self.mask
      )
      # B x (D_en + D_attn_rnn)
      decoder_rnn_input = torch.cat((self.query, self.context), -1)
      # self.decoder_hidden and self.decoder_cell: B x D_decoder_rnn
      self.decoder_hidden, self.decoder_cell = self.decoder_rnn(
          decoder_rnn_input, (self.decoder_hidden, self.decoder_cell)
      )
      self.decoder_hidden = F.dropout(
          self.decoder_hidden, self.p_decoder_dropout, self.training
      )
      # B x (D_decoder_rnn + D_en)
      decoder_hidden_context = torch.cat(
          (self.decoder_hidden, self.context), dim=1
      )
      # B x (self.r * self.frame_channels)
      decoder_output = self.linear_projection(decoder_hidden_context)
      # B x (D_decoder_rnn + (self.r * self.frame_channels))
      stopnet_input = torch.cat(
          (self.decoder_hidden, decoder_output), dim=1
      )
      if self.separate_stopnet:
          stop_token = self.stopnet(stopnet_input.detach())
      else:
          stop_token = self.stopnet(stopnet_input)
      # select outputs for the reduction rate self.r
      decoder_output = decoder_output[:, : self.r * self.frame_channels]
      return (
          decoder_output,
          self.attention.attention_weights,
          stop_token,
      )
  
imports: import torch
  from torch import nn
  from torch.nn import functional
  from .common_layers import Prenet, Linear
  from .attentions import init_attn
label_desc: Use image node_id 8 for calling the Decoder obj's underlying member method code with example usage: obj.decode(memory) and returns: decoder_output,  self,  stop_token