class_docstr: E2E module.
  
  :param List idims: List of dimensions of inputs
  :param int odim: dimension of outputs
  :param Namespace args: argument Namespace containing options
docstr: E2E attention calculation.
  
  :param List xs_pad_list: list of batch (torch.Tensor) of padded input sequences
                          [(B, Tmax_1, idim), (B, Tmax_2, idim),..]
  :param List ilens_list:
      list of batch (torch.Tensor) of lengths of input sequences [(B), (B), ..]
  :param torch.Tensor ys_pad:
      batch of padded character id sequence tensor (B, Lmax)
  :return: attention weights with the following shape,
      1) multi-head case => attention weights (B, H, Lmax, Tmax),
      2) multi-encoder case
          => [(B, Lmax, Tmax1), (B, Lmax, Tmax2), ..., (B, Lmax, NumEncs)]
      3) other case => attention weights (B, Lmax, Tmax).
  :rtype: float ndarray or list
code: def calculate_all_attentions(self, xs_pad_list, ilens_list, ys_pad):
      """E2E attention calculation.
  
      :param List xs_pad_list: list of batch (torch.Tensor) of padded input sequences
                              [(B, Tmax_1, idim), (B, Tmax_2, idim),..]
      :param List ilens_list:
          list of batch (torch.Tensor) of lengths of input sequences [(B), (B), ..]
      :param torch.Tensor ys_pad:
          batch of padded character id sequence tensor (B, Lmax)
      :return: attention weights with the following shape,
          1) multi-head case => attention weights (B, H, Lmax, Tmax),
          2) multi-encoder case
              => [(B, Lmax, Tmax1), (B, Lmax, Tmax2), ..., (B, Lmax, NumEncs)]
          3) other case => attention weights (B, Lmax, Tmax).
      :rtype: float ndarray or list
      """
      self.eval()
      with torch.no_grad():
          # 1. Encoder
          if self.replace_sos:
              tgt_lang_ids = ys_pad[:, 0:1]
              ys_pad = ys_pad[
                  :, 1:
              ]  # remove target language ID in the beginning
          else:
              tgt_lang_ids = None
  
          hs_pad_list, hlens_list = [], []
          for idx in range(self.num_encs):
              hs_pad, hlens, _ = self.enc[idx](
                  xs_pad_list[idx], ilens_list[idx]
              )
              hs_pad_list.append(hs_pad)
              hlens_list.append(hlens)
  
          # 2. Decoder
          att_ws = self.dec.calculate_all_attentions(
              hs_pad_list, hlens_list, ys_pad, lang_ids=tgt_lang_ids
          )
      self.train()
      return att_ws
  
imports: import argparse
  import logging
  import math
  import os
  from itertools import groupby
  import chainer
  import numpy
  import torch
  from chainer import reporter
  from espnet.nets.asr_interface import ASRInterface
  from espnet.nets.e2e_asr_common import label_smoothing_dist
  from espnet.nets.pytorch_backend.ctc import ctc_for
  from espnet.nets.pytorch_backend.nets_utils import get_subsample, pad_list, to_device, to_torch_tensor
  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, encoder_for
  from espnet.nets.scorers.ctc import CTCPrefixScorer
  from espnet.utils.cli_utils import strtobool
label_desc: Use image node_id 14 for calling the E2E obj's underlying member method code with example usage: obj.calculate_all_attentions(xs_pad_list, ilens_list, ys_pad) and returns: att_ws