code: def eval_net(args, net, dataloader, criterion):
      total = 0
      total_loss = 0
      total_correct = 0
  
      for data in dataloader:
          graphs, labels = data
          labels = labels.as_in_context(args.device)
          feat = graphs.ndata["attr"].as_in_context(args.device)
  
          total += len(labels)
          graphs = graphs.to(args.device)
          outputs = net(graphs, feat)
          predicted = nd.argmax(outputs, axis=1)
          predicted = predicted.astype("int64")
  
          total_correct += (predicted == labels).sum().asscalar()
          loss = criterion(outputs, labels)
          # crossentropy(reduce=True) for default
          total_loss += loss.sum().asscalar()
  
      loss, acc = 1.0 * total_loss / total, 1.0 * total_correct / total
  
      return loss, acc
  
file_path: dgl/examples/mxnet/gin/main.py
imports: import sys
  from parser import Parser
  import mxnet
  import numpy
  from dataloader import collate, GraphDataLoader
  from dgl.data.gindt import GINDataset
  from gin import GIN
  from mxnet import gluon, nd
  from mxnet.gluon import nn
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: eval_net(args, net, dataloader, criterion) and returns: loss,  acc