class_docstr: Chainer implementation of ctc layer.
  
  Args:
      odim (int): The output dimension.
      eprojs (int | None): Dimension of input vectors from encoder.
      dropout_rate (float): Dropout rate.
class_docstr_tok: ["Chainer","implementation","of","ctc","layer",".","Args",":","odim","(","int",")",":","The","output","dimension",".","eprojs","(","int","|","None",")",":","Dimension","of","input","vectors","from","encoder",".","dropout_rate","(","float",")",":","Dropout","rate","."]
docstr: CTC forward.
  
  Args:
      hs (list of chainer.Variable | N-dimension array):
          Input variable from encoder.
      ys (list of chainer.Variable | N-dimension array):
          Input variable of decoder.
  
  Returns:
      chainer.Variable: A variable holding a scalar value of the CTC loss.
docstr_tok: ["CTC","forward",".","Args",":","hs","(","list","of","chainer.Variable","|","N-dimension","array",")",":","Input","variable","from","encoder",".","ys","(","list","of","chainer.Variable","|","N-dimension","array",")",":","Input","variable","of","decoder",".","Returns",":","chainer.Variable",":","A","variable","holding","a","scalar","value","of","the","CTC","loss","."]
code: def __call__(self, hs, ys):
      """CTC forward.
  
      Args:
          hs (list of chainer.Variable | N-dimension array):
              Input variable from encoder.
          ys (list of chainer.Variable | N-dimension array):
              Input variable of decoder.
  
      Returns:
          chainer.Variable: A variable holding a scalar value of the CTC loss.
  
      """
      self.loss = None
      ilens = [x.shape[0] for x in hs]
      olens = [x.shape[0] for x in ys]
  
      # zero padding for hs
      y_hat = self.ctc_lo(
          F.dropout(F.pad_sequence(hs), ratio=self.dropout_rate),
          n_batch_axes=2,
      )
      y_hat = F.separate(y_hat, axis=1)  # ilen list of batch x hdim
  
      # zero padding for ys
      y_true = F.pad_sequence(ys, padding=-1)  # batch x olen
  
      # get length info
      input_length = chainer.Variable(
          self.xp.array(ilens, dtype=np.int32)
      )
      label_length = chainer.Variable(
          self.xp.array(olens, dtype=np.int32)
      )
      logging.info(
          self.__class__.__name__
          + " input lengths:  "
          + str(input_length.data)
      )
      logging.info(
          self.__class__.__name__
          + " output lengths: "
          + str(label_length.data)
      )
  
      # get ctc loss
      self.loss = F.connectionist_temporal_classification(
          y_hat, y_true, 0, input_length, label_length
      )
      logging.info("ctc loss:" + str(self.loss.data))
  
      return self.loss
  
file_path: espnet/espnet/nets/chainer_backend/ctc.py
imports: import logging
  import chainer
  import chainer.functions
  import chainer.links
  import numpy
label_desc: Use image node_id 2 for calling the CTC obj's underlying member method code with example usage: obj.__call__(hs, ys) and returns: self