code: def build_attention_list(
      eprojs: int,
      dunits: int,
      atype: str = "location",
      num_att: int = 1,
      num_encs: int = 1,
      aheads: int = 4,
      adim: int = 320,
      awin: int = 5,
      aconv_chans: int = 10,
      aconv_filts: int = 100,
      han_mode: bool = False,
      han_type=None,
      han_heads: int = 4,
      han_dim: int = 320,
      han_conv_chans: int = -1,
      han_conv_filts: int = 100,
      han_win: int = 5,
  ):
      att_list = torch.nn.ModuleList()
      if num_encs == 1:
          for i in range(num_att):
              att = initial_att(
                  atype,
                  eprojs,
                  dunits,
                  aheads,
                  adim,
                  awin,
                  aconv_chans,
                  aconv_filts,
              )
              att_list.append(att)
      elif num_encs > 1:  # no multi-speaker mode
          if han_mode:
              att = initial_att(
                  han_type,
                  eprojs,
                  dunits,
                  han_heads,
                  han_dim,
                  han_win,
                  han_conv_chans,
                  han_conv_filts,
                  han_mode=True,
              )
              return att
          else:
              att_list = torch.nn.ModuleList()
              for idx in range(num_encs):
                  att = initial_att(
                      atype[idx],
                      eprojs,
                      dunits,
                      aheads[idx],
                      adim[idx],
                      awin[idx],
                      aconv_chans[idx],
                      aconv_filts[idx],
                  )
                  att_list.append(att)
      else:
          raise ValueError(
              "Number of encoders needs to be more than one. {}".format(
                  num_encs
              )
          )
      return att_list
  
file_path: espnet/espnet2/asr/decoder/rnn_decoder.py
imports: import random
  import numpy
  import torch
  import torch.nn.functional
  from typeguard import check_argument_types
  from espnet2.asr.decoder.abs_decoder import AbsDecoder
  from espnet2.utils.get_default_kwargs import get_default_kwargs
  from espnet.nets.pytorch_backend.nets_utils import make_pad_mask, to_device
  from espnet.nets.pytorch_backend.rnn.attentions import initial_att
label_desc: Use image node_id 1 for calling a global function with example usage: build_attention_list(eprojs, dunits, atype, num_att, num_encs, aheads, adim, awin, aconv_chans, aconv_filts, han_mode, han_type, han_heads, han_dim, han_conv_chans, han_conv_filts, han_win) and returns: att_list, att