class_docstr: Tacotron decoder.
  
  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_windowing (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.
      d_vector_dim (int): size of speaker embedding vector, for multi-speaker training.
      max_decoder_steps (int): Maximum number of steps allowed for the decoder. Defaults to 500.
class_docstr_tok: ["Tacotron","decoder",".","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_windowing","(","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",".","d_vector_dim","(","int",")",":","size","of","speaker","embedding","vector",",","for","multi-speaker","training",".","max_decoder_steps","(","int",")",":","Maximum","number","of","steps","allowed","for","the","decoder",".","Defaults","to","500","."]
docstr: Args:
      inputs: Encoder outputs.
      memory: Decoder memory (autoregression. If None (at eval-time),
        decoder outputs are used as decoder inputs. If None, it uses the last
        output as the input.
      mask: Attention mask for sequence padding.
  
  Shapes:
      - inputs: (B, T, D_out_enc)
      - memory: (B, T_mel, D_mel)
docstr_tok: ["Args",":","inputs",":","Encoder","outputs",".","memory",":","Decoder","memory","(","autoregression",".","If","None","(","at","eval-time",")",",","decoder","outputs","are","used","as","decoder","inputs",".","If","None",",","it","uses","the","last","output","as","the","input",".","mask",":","Attention","mask","for","sequence","padding",".","Shapes",":","-","inputs",":","(","B",",","T",",","D_out_enc",")","-","memory",":","(","B",",","T_mel",",","D_mel",")"]
code: def forward(self, inputs, memory, mask):
      """
      Args:
          inputs: Encoder outputs.
          memory: Decoder memory (autoregression. If None (at eval-time),
            decoder outputs are used as decoder inputs. If None, it uses the last
            output as the input.
          mask: Attention mask for sequence padding.
  
      Shapes:
          - inputs: (B, T, D_out_enc)
          - memory: (B, T_mel, D_mel)
      """
      # Run greedy decoding if memory is None
      memory = self._reshape_memory(memory)
      outputs = []
      attentions = []
      stop_tokens = []
      t = 0
      self._init_states(inputs)
      self.attention.init_states(inputs)
      while len(outputs) < memory.size(0):
          if t > 0:
              new_memory = memory[t - 1]
              self._update_memory_input(new_memory)
  
          output, stop_token, attention = self.decode(inputs, mask)
          outputs += [output]
          attentions += [attention]
          stop_tokens += [stop_token.squeeze(1)]
          t += 1
      return self._parse_outputs(outputs, attentions, stop_tokens)
  
imports: import torch
  from torch import nn
  from .attentions import init_attn
  from .common_layers import Prenet
label_desc: Use image node_id 8 for calling the Decoder obj's underlying member method code with example usage: obj.forward(inputs, memory, mask) and returns: self