code: def test_auxiliary_task(train_dic):
      train_args = make_train_args(**train_dic)
      recog_args = make_recog_args()
  
      model, feats, feats_len, labels, data, uttid_list = prepare(
          train_args
      )
  
      optim = torch.optim.Adam(model.parameters(), 0.01)
      loss = model(feats, feats_len, labels)
  
      optim.zero_grad()
      loss.backward()
      optim.step()
  
      beam_search = BeamSearchTransducer(
          decoder=model.decoder,
          joint_network=model.transducer_tasks.joint_network,
          beam_size=recog_args.beam_size,
          lm=recog_args.rnnlm,
          lm_weight=recog_args.lm_weight,
          search_type=recog_args.search_type,
          max_sym_exp=recog_args.max_sym_exp,
          u_max=recog_args.u_max,
          nstep=recog_args.nstep,
          prefix_alpha=recog_args.prefix_alpha,
          score_norm=recog_args.score_norm_transducer,
      )
  
      tmpdir = tempfile.mkdtemp(prefix="tmp_", dir="/tmp")
      torch.save(model.state_dict(), tmpdir + "/model.dummy.best")
  
      with open(tmpdir + "/model.json", "wb") as f:
          f.write(
              json.dumps(
                  (12, 5, vars(train_args)),
                  indent=4,
                  ensure_ascii=False,
                  sort_keys=True,
              ).encode("utf_8")
          )
  
      with torch.no_grad():
          model, _ = load_trained_model(
              tmpdir + "/model.dummy.best", training=False
          )
  
          nbest = model.recognize(
              feats[0, : feats_len[0]].numpy(), beam_search
          )
  
          print(nbest[0]["yseq"][1:-1])
  
imports: import argparse
  import json
  import tempfile
  import pytest
  import torch
  from packaging.version import parse
  import espnet.lm.pytorch_backend.extlm
  import espnet.nets.pytorch_backend.lm.default
  from espnet.asr.pytorch_backend.asr_init import load_trained_model
  from espnet.nets.beam_search_transducer import BeamSearchTransducer
  from espnet.nets.pytorch_backend.e2e_asr_transducer import E2E
  from espnet.nets.pytorch_backend.transducer.blocks import build_blocks
label_desc: Use image node_id 9 for calling a global function with example usage: test_auxiliary_task(train_dic) without return types