class_docstr: E2E module.
  
  :param int idim: dimension of inputs
  :param int odim: dimension of outputs
  :param Namespace args: argument Namespace containing options
class_docstr_tok: ["E2E","module",".",":","param","int","idim",":","dimension","of","inputs",":","param","int","odim",":","dimension","of","outputs",":","param","Namespace","args",":","argument","Namespace","containing","options"]
docstr: E2E forward.
  
  :param torch.Tensor xs_pad: batch of padded input sequences (B, Tmax, idim)
  :param torch.Tensor ilens: batch of lengths of input sequences (B)
  :param torch.Tensor ys_pad: batch of padded token id sequence tensor (B, Lmax)
  :return: loss value
  :rtype: torch.Tensor
docstr_tok: ["E2E","forward",".",":","param","torch.Tensor","xs_pad",":","batch","of","padded","input","sequences","(","B",",","Tmax",",","idim",")",":","param","torch.Tensor","ilens",":","batch","of","lengths","of","input","sequences","(","B",")",":","param","torch.Tensor","ys_pad",":","batch","of","padded","token","id","sequence","tensor","(","B",",","Lmax",")",":","return",":","loss","value",":","rtype",":","torch.Tensor"]
code: def forward(self, xs_pad, ilens, ys_pad):
      """E2E forward.
  
      :param torch.Tensor xs_pad: batch of padded input sequences (B, Tmax, idim)
      :param torch.Tensor ilens: batch of lengths of input sequences (B)
      :param torch.Tensor ys_pad: batch of padded token id sequence tensor (B, Lmax)
      :return: loss value
      :rtype: torch.Tensor
      """
      # 1. Encoder
      xs_pad, ys_pad = self.target_language_biasing(
          xs_pad, ilens, ys_pad
      )
      hs_pad, hlens, _ = self.enc(
          self.dropout(self.embed(xs_pad)), ilens
      )
  
      # 3. attention loss
      self.loss, self.acc, self.ppl = self.dec(hs_pad, hlens, ys_pad)
  
      # 4. compute bleu
      if self.training or not self.report_bleu:
          self.bleu = 0.0
      else:
          lpz = None
  
          nbest_hyps = self.dec.recognize_beam_batch(
              hs_pad,
              torch.tensor(hlens),
              lpz,
              self.trans_args,
              self.char_list,
              self.rnnlm,
          )
          # remove <sos> and <eos>
          list_of_refs = []
          hyps = []
          y_hats = [
              nbest_hyp[0]["yseq"][1:-1] for nbest_hyp in nbest_hyps
          ]
          for i, y_hat in enumerate(y_hats):
              y_true = ys_pad[i]
  
              seq_hat = [
                  self.char_list[int(idx)]
                  for idx in y_hat
                  if int(idx) != -1
              ]
              seq_true = [
                  self.char_list[int(idx)]
                  for idx in y_true
                  if int(idx) != -1
              ]
              seq_hat_text = "".join(seq_hat).replace(
                  self.trans_args.space, " "
              )
              seq_hat_text = seq_hat_text.replace(
                  self.trans_args.blank, ""
              )
              seq_true_text = "".join(seq_true).replace(
                  self.trans_args.space, " "
              )
  
              hyps += [seq_hat_text.split(" ")]
              list_of_refs += [[seq_true_text.split(" ")]]
  
          self.bleu = (
              nltk.bleu_score.corpus_bleu(list_of_refs, hyps) * 100
          )
  
      loss_data = float(self.loss)
      if not math.isnan(loss_data):
          self.reporter.report(loss_data, self.acc, self.ppl, self.bleu)
      else:
          logging.warning("loss (=%f) is not correct", loss_data)
      return self.loss
  
imports: import argparse
  import logging
  import math
  import os
  import chainer
  import nltk
  import numpy
  import torch
  from chainer import reporter
  from espnet.nets.e2e_asr_common import label_smoothing_dist
  from espnet.nets.mt_interface import MTInterface
  from espnet.nets.pytorch_backend.initialization import uniform_init_parameters
  from espnet.nets.pytorch_backend.nets_utils import get_subsample, pad_list, to_device
  from espnet.nets.pytorch_backend.rnn.argument import add_arguments_rnn_attention_common, add_arguments_rnn_decoder_common, add_arguments_rnn_encoder_common
  from espnet.nets.pytorch_backend.rnn.attentions import att_for
  from espnet.nets.pytorch_backend.rnn.decoders import decoder_for
  from espnet.nets.pytorch_backend.rnn.encoders import encoder_for
  from espnet.utils.fill_missing_args import fill_missing_args
label_desc: Use image node_id 7 for calling the E2E obj's underlying member method code with example usage: obj.forward(xs_pad, ilens, ys_pad) and returns: self