code: def test_mtl_loss(etype):
      th = importlib.import_module("espnet.nets.pytorch_backend.e2e_st")
      args = make_arg(etype=etype)
      th_model = th.E2E(40, 5, args)
  
      const = 1e-4
      init_torch_weight_const(th_model, const)
  
      th_batch = prepare_inputs("pytorch")
  
      th_model(*th_batch)
      th_asr, th_st = th_model.loss_asr, th_model.loss_st
  
      # test grads in mtl mode
      th_loss = th_asr * 0.5 + th_st * 0.5
      th_model.zero_grad()
      th_loss.backward()
  
imports: from __future__ import division
  import argparse
  import importlib
  import os
  import tempfile
  from test.utils_test import make_dummy_json_st
  import chainer
  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 11 for calling a global function with example usage: test_mtl_loss(etype) without return types