code: def test(ctx, val_data, opt, net):
      acc_top1 = mx.metric.Accuracy()
      acc_top5 = mx.metric.TopKAccuracy(5)
  
      for i, batch in enumerate(val_data):
          data, label = batch_fn(batch, ctx)
          outputs = []
          for _, X in enumerate(data):
              X = X.reshape((-1,) + X.shape[2:])
              pred = net(X.astype(opt.dtype, copy=False))
              if opt.use_softmax:
                  pred = F.softmax(pred, axis=1)
              outputs.append(pred)
  
          acc_top1.update(label, outputs)
          acc_top5.update(label, outputs)
          mx.ndarray.waitall()
  
          _, cur_top1 = acc_top1.get()
          _, cur_top5 = acc_top5.get()
  
          if i > 0 and i % opt.log_interval == 0:
              print(
                  "%04d/%04d is done: acc-top1=%f acc-top5=%f"
                  % (i, len(val_data), cur_top1 * 100, cur_top5 * 100)
              )
  
      _, top1 = acc_top1.get()
      _, top5 = acc_top5.get()
      return (top1, top5)
  
imports: import argparse, time, logging, os, sys, math
  import gc
  import numpy
  import mxnet
  import mxnet.ndarray
  import gluoncv
  from mxnet import gluon, nd, gpu, init, context
  from mxnet import autograd
  from mxnet.gluon import nn
  from mxnet.gluon.data.vision import transforms
  from mxnet.contrib.quantization import *
  from gluoncv.data.transforms import video
  from gluoncv.data import UCF101, Kinetics400, Kinetics700, SomethingSomethingV2, HMDB51
  from gluoncv.model_zoo import get_model
  from gluoncv.utils import makedirs, LRSequential, LRScheduler, split_and_load
label_desc: Use image node_id 3 for calling a global function with example usage: test(ctx, val_data, opt, net) and returns: top1,  top5