code: def test(device, val_data):
      metric.reset()
      val_data.reset()
      for batch in val_data:
          data = gluon.utils.split_and_load(
              batch.data[0].astype(opt.dtype, copy=False),
              device_list=device,
              batch_axis=0,
          )
          label = gluon.utils.split_and_load(
              batch.label[0].astype(opt.dtype, copy=False),
              device_list=device,
              batch_axis=0,
          )
          outputs = [net(X) for X in data]
          metric.update(label, outputs)
      return metric.get()
  
file_path: mxnet/example/gluon/image_classification.py
imports: from __future__ import division
  import argparse, time, os
  import logging
  import mxnet
  from mxnet import gluon
  from mxnet import profiler
  from mxnet.gluon import nn
  from mxnet.gluon.model_zoo import vision
  from mxnet import autograd
  from mxnet.test_utils import get_mnist_iterator
  from mxnet.gluon.metric import Accuracy, TopKAccuracy, CompositeEvalMetric
  import numpy
  from data import get_cifar10_iterator, get_imagenet_iterator, get_caltech101_iterator, dummy_iterator
label_desc: Use image node_id 3 for calling a global function with example usage: test(device, val_data) and returns: metric