code: def test_calculate_all_attentions(module, num_encs, atype):
      m = importlib.import_module(module)
      args = make_arg(
          num_encs=num_encs,
          atype=[atype for _ in range(num_encs)],
          han_type=atype,
      )
      batch = prepare_inputs("pytorch", num_encs)
      model = m.E2E([2 for _ in range(num_encs)], 2, args)
      att_ws = model.calculate_all_attentions(*batch)
      for i in range(num_encs):
          print(att_ws[i][0].shape)  # att
      print(att_ws[num_encs][0].shape)
  
imports: from __future__ import division
  import argparse
  import importlib
  import os
  import tempfile
  from test.utils_test import make_dummy_json
  import numpy
  import pytest
  import torch
  from espnet.nets.pytorch_backend.nets_utils import pad_list
  from espnet.utils.training.batchfy import make_batchset
label_desc: Use image node_id 10 for calling a global function with example usage: test_calculate_all_attentions(module, num_encs, atype) without return types