code: def merge(eval_path, cfg):
      dict_feats = {}
      dict_label = {}
      dict_pos = {}
      print("Reading individual output files")
  
      for x in range(cfg.DDP_CONFIG.GPU_WORLD_SIZE):
          file = os.path.join(eval_path, str(x) + ".txt")
          lines = open(file, "r").readlines()[1:]
          for line in lines:
              line = line.strip()
              name = line.split("[")[0]
              label = line.split("]")[1].split(" ")[1]
              chunk_nb = line.split("]")[1].split(" ")[2]
              split_nb = line.split("]")[1].split(" ")[3]
              data = np.fromstring(
                  line.split("[")[1].split("]")[0],
                  dtype=np.float,
                  sep=",",
              )
              if not name in dict_feats:
                  dict_feats[name] = []
                  dict_label[name] = 0
                  dict_pos[name] = []
              if chunk_nb + split_nb in dict_pos[name]:
                  continue
              dict_feats[name].append(data)
              dict_pos[name].append(chunk_nb + split_nb)
              dict_label[name] = label
      print("Computing final results")
  
      input_lst = []
      print(len(dict_feats))
      for i, item in enumerate(dict_feats):
          input_lst.append(
              [i, item, dict_feats[item], dict_label[item]]
          )
      from multiprocessing import Pool
  
      p = Pool(64)
      ans = p.map(compute_video, input_lst)
      top1 = [x[1] for x in ans]
      top5 = [x[2] for x in ans]
      pred = [x[0] for x in ans]
      label = [x[3] for x in ans]
      print(np.mean(top1), np.mean(top5))
  
file_path: gluon-cv/scripts/action-recognition/test_ddp_pytorch.py
imports: import os
  import argparse
  import numpy
  import torch
  import torch.nn
  import torch.distributed
  import torch.optim
  from tensorboardX import SummaryWriter
  from gluoncv.torch.model_zoo import get_model
  from gluoncv.torch.utils.model_utils import deploy_model, load_model
  from gluoncv.torch.data import build_dataloader_test
  from gluoncv.torch.utils.task_utils import test_classification
  from gluoncv.torch.engine.config import get_cfg_defaults
  from gluoncv.torch.engine.launch import spawn_workers
  from gluoncv.torch.utils.utils import build_log_dir
label_desc: Use image node_id 2 for calling a global function with example usage: merge(eval_path, cfg) without return types