code: def test_transformer_mask():
      args = make_arg()
      model, x, ilens, y, data, uttid_list = prepare("pytorch", args)
      yi, yo = add_sos_eos(y, model.sos, model.eos, model.ignore_id)
      y_mask = target_mask(yi, model.ignore_id)
      y = model.decoder.embed(yi)
      y[0, 3:] = float("nan")
      a = model.decoder.decoders[0].self_attn
      a(y, y, y, y_mask)
      assert not numpy.isnan(
          a.attn[0, :, :3, :3].detach().numpy()
      ).any()
  
file_path: espnet/test/test_e2e_asr_transformer.py
imports: import argparse
  import chainer
  import numpy
  import pytest
  import torch
  import espnet.nets.chainer_backend.e2e_asr_transformer
  import espnet.nets.pytorch_backend.e2e_asr_transformer
  from espnet.nets.pytorch_backend.nets_utils import rename_state_dict
  from espnet.nets.pytorch_backend.transformer import plot
  from espnet.nets.pytorch_backend.transformer.add_sos_eos import add_sos_eos
  from espnet.nets.pytorch_backend.transformer.mask import subsequent_mask, target_mask
label_desc: Use image node_id 6 for calling a global function with example usage: test_transformer_mask() without return types