code: def test_sortagrad_trainable(module):
      args = make_arg(sortagrad=1)
      dummy_json = make_dummy_json_mt(
          4, [10, 20], [10, 20], idim=6, odim=5
      )
      if module == "pytorch":
          import espnet.nets.pytorch_backend.e2e_mt as m
      else:
          import espnet.nets.chainer_backend.e2e_mt as m
      batchset = make_batchset(
          dummy_json,
          2,
          2**10,
          2**10,
          shortest_first=True,
          mt=True,
          iaxis=1,
          oaxis=0,
      )
      model = m.E2E(6, 5, args)
      for batch in batchset:
          loss = model(*convert_batch(batch, module, idim=6, odim=5))
          if isinstance(loss, tuple):
              # chainer return several values as tuple
              loss[0].backward()  # trainable
          else:
              loss.backward()  # trainable
      with torch.no_grad(), chainer.no_backprop_mode():
          in_data = np.random.randint(0, 5, (1, 100))
          model.translate(in_data, args, args.char_list)
  
imports: from __future__ import division
  import argparse
  import importlib
  import os
  import tempfile
  from test.utils_test import make_dummy_json_mt
  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 5 for calling a global function with example usage: test_sortagrad_trainable(module) without return types