code: def test(device):
      val_data.reset()
      avg_psnr = 0
      batches = 0
      for batch in val_data:
          batches += 1
          data = gluon.utils.split_and_load(
              batch.data[0], device_list=device, batch_axis=0
          )
          label = gluon.utils.split_and_load(
              batch.label[0], device_list=device, batch_axis=0
          )
          outputs = []
          for x in data:
              outputs.append(net(x))
          metric.update(label, outputs)
          avg_psnr += 10 * math.log10(1 / metric.get()[1])
          metric.reset()
      avg_psnr /= batches
      print(f"validation avg psnr: {avg_psnr}")
  
imports: from __future__ import print_function
  import argparse
  import math
  import os
  import shutil
  import sys
  import zipfile
  from os import path
  import numpy
  import mxnet
  from mxnet import gluon, autograd
  from mxnet.gluon import nn
  from mxnet.image import CenterCropAug, ResizeAug
  from mxnet.io import PrefetchingIter
  from mxnet.test_utils import download
  from data import ImagePairIter
label_desc: Use image node_id 2 for calling a global function with example usage: test(device) without return types