docstr: Decoder step using stored states, attention and memory
  PARAMS
  ------
  decoder_input: previous mel output
  
  RETURNS
  -------
  mel_output:
  gate_output: gate output energies
  attention_weights:
docstr_tok: ["Decoder","step","using","stored","states",",","attention","and","memory","PARAMS","--","--","--","decoder_input",":","previous","mel","output","RETURNS","--","--","--","-","mel_output",":","gate_output",":","gate","output","energies","attention_weights",":"]
code: def decode(self, decoder_input):
      """Decoder step using stored states, attention and memory
      PARAMS
      ------
      decoder_input: previous mel output
  
      RETURNS
      -------
      mel_output:
      gate_output: gate output energies
      attention_weights:
      """
      cell_input = torch.cat(
          (decoder_input, self.attention_context), -1
      )
      self.attention_hidden, self.attention_cell = self.attention_rnn(
          cell_input, (self.attention_hidden, self.attention_cell)
      )
      self.attention_hidden = F.dropout(
          self.attention_hidden, self.p_attention_dropout, self.training
      )
  
      attention_weights_cat = torch.cat(
          (
              self.attention_weights.unsqueeze(1),
              self.attention_weights_cum.unsqueeze(1),
          ),
          dim=1,
      )
      (
          self.attention_context,
          self.attention_weights,
      ) = self.attention_layer(
          self.attention_hidden,
          self.memory,
          self.processed_memory,
          attention_weights_cat,
          self.mask,
      )
  
      self.attention_weights_cum += self.attention_weights
      decoder_input = torch.cat(
          (self.attention_hidden, self.attention_context), -1
      )
      if self.obs_and_lat is not None:
          decoder_input = torch.cat(
              (decoder_input, self.obs_and_lat), -1
          )
      self.decoder_hidden, self.decoder_cell = self.decoder_rnn(
          decoder_input, (self.decoder_hidden, self.decoder_cell)
      )
      self.decoder_hidden = F.dropout(
          self.decoder_hidden, self.p_decoder_dropout, self.training
      )
  
      decoder_hidden_attention_context = torch.cat(
          (self.decoder_hidden, self.attention_context), dim=1
      )
      if self.obs_and_lat is not None:
          decoder_hidden_attention_context = torch.cat(
              (decoder_hidden_attention_context, self.obs_and_lat),
              dim=1,
          )
      decoder_output = self.linear_projection(
          decoder_hidden_attention_context
      )
  
      gate_prediction = self.gate_layer(
          decoder_hidden_attention_context
      )
      return decoder_output, gate_prediction, self.attention_weights
  
imports: from math import sqrt
  import torch
  import torch.distributions
  from torch.autograd import Variable
  from torch import nn
  from torch.nn import functional
  from .layers import ConvNorm, LinearNorm, GlobalAvgPool
  from .utils import to_gpu, get_mask_from_lengths
label_desc: Use image node_id 6 for calling the Decoder obj's underlying member method code with example usage: obj.decode(decoder_input) and returns: decoder_output,  gate_prediction,  self