class_docstr: E2E module.
  
  Args:
      idim (int): Input dimmensions.
      odim (int): Output dimmensions.
      args (Namespace): Training config.
      ignore_id (int, optional): Id for ignoring a character.
      flag_return (bool, optional): If true, return a list with (loss,
      loss_ctc, loss_att, acc) in forward. Otherwise, return loss.
class_docstr_tok: ["E2E","module",".","Args",":","idim","(","int",")",":","Input","dimmensions",".","odim","(","int",")",":","Output","dimmensions",".","args","(","Namespace",")",":","Training","config",".","ignore_id","(","int",",","optional",")",":","Id","for","ignoring","a","character",".","flag_return","(","bool",",","optional",")",":","If","true",",","return","a","list","with","(","loss",",","loss_ctc",",","loss_att",",","acc",")","in","forward",".","Otherwise",",","return","loss","."]
docstr: E2E attention calculation.
  
  Args:
      xs (List[tuple()]): List of padded input sequences.
          [(T1, idim), (T2, idim), ...]
      ilens (ndarray): Batch of lengths of input sequences. (B)
      ys (List): List of character id sequence tensor. [(L1), (L2), (L3), ...]
  
  Returns:
      float ndarray: Attention weights. (B, Lmax, Tmax)
docstr_tok: ["E2E","attention","calculation",".","Args",":","xs","(","List","[","tuple","(",")","]",")",":","List","of","padded","input","sequences",".","[","(","T1",",","idim",")",",","(","T2",",","idim",")",",","...","]","ilens","(","ndarray",")",":","Batch","of","lengths","of","input","sequences",".","(","B",")","ys","(","List",")",":","List","of","character","id","sequence","tensor",".","[","(","L1",")",",","(","L2",")",",","(","L3",")",",","...","]","Returns",":","float","ndarray",":","Attention","weights",".","(","B",",","Lmax",",","Tmax",")"]
code: def calculate_all_attentions(self, xs, ilens, ys):
      """E2E attention calculation.
  
      Args:
          xs (List[tuple()]): List of padded input sequences.
              [(T1, idim), (T2, idim), ...]
          ilens (ndarray): Batch of lengths of input sequences. (B)
          ys (List): List of character id sequence tensor. [(L1), (L2), (L3), ...]
  
      Returns:
          float ndarray: Attention weights. (B, Lmax, Tmax)
  
      """
      with chainer.no_backprop_mode():
          self(xs, ilens, ys, calculate_attentions=True)
      ret = dict()
      for name, m in self.namedlinks():
          if isinstance(m, MultiHeadAttention):
              var = m.attn
              var.to_cpu()
              _name = name[1:].replace("/", "_")
              ret[_name] = var.data
      return ret
  
imports: import logging
  import math
  from argparse import Namespace
  from distutils.util import strtobool
  import chainer
  import chainer.functions
  import numpy
  from chainer import reporter
  from espnet.nets.chainer_backend.asr_interface import ChainerASRInterface
  from espnet.nets.chainer_backend.transformer import ctc
  from espnet.nets.chainer_backend.transformer.attention import MultiHeadAttention
  from espnet.nets.chainer_backend.transformer.decoder import Decoder
  from espnet.nets.chainer_backend.transformer.encoder import Encoder
  from espnet.nets.chainer_backend.transformer.label_smoothing_loss import LabelSmoothingLoss
  from espnet.nets.chainer_backend.transformer.training import CustomConverter, CustomParallelUpdater, CustomUpdater
  from espnet.nets.ctc_prefix_score import CTCPrefixScore
  from espnet.nets.e2e_asr_common import ErrorCalculator, end_detect
  from espnet.nets.pytorch_backend.nets_utils import get_subsample
  from espnet.nets.pytorch_backend.transformer.plot import PlotAttentionReport
label_desc: Use image node_id 9 for calling the E2E obj's underlying member method code with example usage: obj.calculate_all_attentions(xs, ilens, ys) and returns: ret