class_docstr: Decoder layer.
  
  Args:
      eprojs (int): Dimension of input variables from encoder.
      odim (int): The output dimension.
      dtype (str): Decoder type.
      dlayers (int): Number of layers for decoder.
      dunits (int): Dimension of input vector of decoder.
      sos (int): Number to indicate the start of sequences.
      eos (int): Number to indicate the end of sequences.
      att (Module): Attention module defined at
          `espnet.espnet.nets.chainer_backend.attentions`.
      verbose (int): Verbosity level.
      char_list (List[str]): List of all characters.
      labeldist (numpy.array): Distributed array of counted transcript length.
      lsm_weight (float): Weight to use when calculating the training loss.
      sampling_probability (float): Threshold for scheduled sampling.
class_docstr_tok: ["Decoder","layer",".","Args",":","eprojs","(","int",")",":","Dimension","of","input","variables","from","encoder",".","odim","(","int",")",":","The","output","dimension",".","dtype","(","str",")",":","Decoder","type",".","dlayers","(","int",")",":","Number","of","layers","for","decoder",".","dunits","(","int",")",":","Dimension","of","input","vector","of","decoder",".","sos","(","int",")",":","Number","to","indicate","the","start","of","sequences",".","eos","(","int",")",":","Number","to","indicate","the","end","of","sequences",".","att","(","Module",")",":","Attention","module","defined","at","`","espnet.espnet.nets.chainer_backend.attentions","`",".","verbose","(","int",")",":","Verbosity","level",".","char_list","(","List","[","str","]",")",":","List","of","all","characters",".","labeldist","(","numpy.array",")",":","Distributed","array","of","counted","transcript","length",".","lsm_weight","(","float",")",":","Weight","to","use","when","calculating","the","training","loss",".","sampling_probability","(","float",")",":","Threshold","for","scheduled","sampling","."]
code: def rnn_forward(self, ey, z_list, c_list, z_prev, c_prev):
      if self.dtype == "lstm":
          c_list[0], z_list[0] = self.rnn0(c_prev[0], z_prev[0], ey)
          for i in range(1, self.dlayers):
              c_list[i], z_list[i] = self["rnn%d" % i](
                  c_prev[i], z_prev[i], z_list[i - 1]
              )
      else:
          if z_prev[0] is None:
              xp = self.xp
              with chainer.backends.cuda.get_device_from_id(
                  self._device_id
              ):
                  z_prev[0] = chainer.Variable(
                      xp.zeros(
                          (ey.shape[0], self.dunits), dtype=ey.dtype
                      )
                  )
          z_list[0] = self.rnn0(z_prev[0], ey)
          for i in range(1, self.dlayers):
              if z_prev[i] is None:
                  xp = self.xp
                  with chainer.backends.cuda.get_device_from_id(
                      self._device_id
                  ):
                      z_prev[i] = chainer.Variable(
                          xp.zeros(
                              (z_list[i - 1].shape[0], self.dunits),
                              dtype=z_list[i - 1].dtype,
                          )
                      )
              z_list[i] = self["rnn%d" % i](z_prev[i], z_list[i - 1])
      return z_list, c_list
  
file_path: espnet/espnet/nets/chainer_backend/rnn/decoders.py
imports: import logging
  import random
  from argparse import Namespace
  import chainer
  import chainer.functions
  import chainer.links
  import numpy
  import espnet.nets.chainer_backend.deterministic_embed_id
  from espnet.nets.ctc_prefix_score import CTCPrefixScore
  from espnet.nets.e2e_asr_common import end_detect
label_desc: Use image node_id 2 for calling the Decoder obj's underlying member method code with example usage: obj.rnn_forward(ey, z_list, c_list, z_prev, c_prev) and returns: z_list,  c_list