class_docstr: E2E module for chainer backend.
  
  Args:
      idim (int): Dimension of the inputs.
      odim (int): Dimension of the outputs.
      args (parser.args): Training config.
      flag_return (bool): If True, train() would return
          additional metrics in addition to the training
          loss.
docstr: E2E attention calculation.
  
  Args:
      xs (List): List of padded input sequences. [(T1, idim), (T2, idim), ...]
      ilens (np.ndarray): Batch of lengths of input sequences. (B)
      ys (List): List of character id sequence tensor. [(L1), (L2), (L3), ...]
  
  Returns:
      float np.ndarray: Attention weights. (B, Lmax, Tmax)
docstr_tok: ["E2E","attention","calculation",".","Args",":","xs","(","List",")",":","List","of","padded","input","sequences",".","[","(","T1",",","idim",")",",","(","T2",",","idim",")",",","...","]","ilens","(","np.ndarray",")",":","Batch","of","lengths","of","input","sequences",".","(","B",")","ys","(","List",")",":","List","of","character","id","sequence","tensor",".","[","(","L1",")",",","(","L2",")",",","(","L3",")",",","...","]","Returns",":","float","np.ndarray",":","Attention","weights",".","(","B",",","Lmax",",","Tmax",")"]
code: def calculate_all_attentions(self, xs, ilens, ys):
      """E2E attention calculation.
  
      Args:
          xs (List): List of padded input sequences. [(T1, idim), (T2, idim), ...]
          ilens (np.ndarray): Batch of lengths of input sequences. (B)
          ys (List): List of character id sequence tensor. [(L1), (L2), (L3), ...]
  
      Returns:
          float np.ndarray: Attention weights. (B, Lmax, Tmax)
  
      """
      hs, ilens = self.enc(xs, ilens)
      att_ws = self.dec.calculate_all_attentions(hs, ys)
  
      return att_ws
  
imports: import logging
  import math
  import chainer
  import numpy
  from chainer import reporter
  from espnet.nets.chainer_backend.asr_interface import ChainerASRInterface
  from espnet.nets.chainer_backend.ctc import ctc_for
  from espnet.nets.chainer_backend.rnn.attentions import att_for
  from espnet.nets.chainer_backend.rnn.decoders import decoder_for
  from espnet.nets.chainer_backend.rnn.encoders import encoder_for
  from espnet.nets.e2e_asr_common import label_smoothing_dist
  from espnet.nets.pytorch_backend.e2e_asr import E2E
  from espnet.nets.pytorch_backend.nets_utils import get_subsample
label_desc: Use image node_id 6 for calling the E2E obj's underlying member method code with example usage: obj.calculate_all_attentions(xs, ilens, ys) and returns: att_ws