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 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)
  :return: attention weights with the following shape,
      1) multi-head case => attention weights (B, H, Lmax, Tmax),
      2) other case => attention weights (B, Lmax, Tmax).
  :rtype: float ndarray
docstr_tok: ["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",")",":","return",":","attention","weights","with","the","following","shape",",","1",")","multi-head","case","=",">","attention","weights","(","B",",","H",",","Lmax",",","Tmax",")",",","2",")","other","case","=",">","attention","weights","(","B",",","Lmax",",","Tmax",")",".",":","rtype",":","float","ndarray"]
code: def calculate_all_attentions(self, xs_pad, ilens, ys_pad):
      """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)
      :return: attention weights with the following shape,
          1) multi-head case => attention weights (B, H, Lmax, Tmax),
          2) other case => attention weights (B, Lmax, Tmax).
      :rtype: float ndarray
      """
      self.eval()
      with torch.no_grad():
          # 1. Encoder
          xs_pad, ys_pad = self.target_language_biasing(
              xs_pad, ilens, ys_pad
          )
          hpad, hlens, _ = self.enc(
              self.dropout(self.embed(xs_pad)), ilens
          )
  
          # 2. Decoder
          att_ws = self.dec.calculate_all_attentions(
              hpad, hlens, ys_pad
          )
      self.train()
      return att_ws
  
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 11 for calling the E2E obj's underlying member method code with example usage: obj.calculate_all_attentions(xs_pad, ilens, ys_pad) and returns: att_ws