class_docstr: E2E module.
  
  :param int idim: dimension of inputs
  :param int odim: dimension of outputs
  :param Namespace args: argument Namespace containing options
docstr: E2E attention calculation.
  
  :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)
  :param torch.Tensor ys_pad_src:
      batch of padded token id sequence tensor (B, Lmax)
  :return: attention weights (B, H, Lmax, Tmax)
  :rtype: float ndarray
code: def calculate_all_attentions(self, xs_pad, ilens, ys_pad, ys_pad_src):
      """E2E attention calculation.
  
      :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)
      :param torch.Tensor ys_pad_src:
          batch of padded token id sequence tensor (B, Lmax)
      :return: attention weights (B, H, Lmax, Tmax)
      :rtype: float ndarray
      """
      self.eval()
      with torch.no_grad():
          self.forward(xs_pad, ilens, ys_pad, ys_pad_src)
      ret = dict()
      for name, m in self.named_modules():
          if (
              isinstance(m, MultiHeadedAttention) and m.attn is not None
          ):  # skip MHA for submodules
              ret[name] = m.attn.cpu().numpy()
      self.train()
      return ret
  
imports: import logging
  import math
  from argparse import Namespace
  import numpy
  import torch
  from espnet.nets.e2e_asr_common import ErrorCalculator
  from espnet.nets.e2e_asr_common import end_detect
  from espnet.nets.e2e_mt_common import ErrorCalculator
  from espnet.nets.pytorch_backend.ctc import CTC
  from espnet.nets.pytorch_backend.e2e_asr import CTC_LOSS_THRESHOLD
  from espnet.nets.pytorch_backend.e2e_st import Reporter
  from espnet.nets.pytorch_backend.nets_utils import get_subsample, make_non_pad_mask, pad_list, th_accuracy
  from espnet.nets.pytorch_backend.transformer.add_sos_eos import add_sos_eos
  from espnet.nets.pytorch_backend.transformer.argument import add_arguments_transformer_common
  from espnet.nets.pytorch_backend.transformer.attention import MultiHeadedAttention
  from espnet.nets.pytorch_backend.transformer.decoder import Decoder
  from espnet.nets.pytorch_backend.transformer.encoder import Encoder
  from espnet.nets.pytorch_backend.transformer.initializer import initialize
  from espnet.nets.pytorch_backend.transformer.label_smoothing_loss import LabelSmoothingLoss
  from espnet.nets.pytorch_backend.transformer.mask import subsequent_mask, target_mask
  from espnet.nets.pytorch_backend.transformer.plot import PlotAttentionReport
  from espnet.nets.st_interface import STInterface
  from espnet.utils.fill_missing_args import fill_missing_args
label_desc: Use image node_id 12 for calling the E2E obj's underlying member method code with example usage: obj.calculate_all_attentions(xs_pad, ilens, ys_pad, ys_pad_src) and returns: ret