code: def test(args, dataset, g, feats, paper_offset):
      print("Loading masks and labels...")
      valid_idx = (
          torch.LongTensor(dataset.get_idx_split("valid"))
          + paper_offset
      )
      test_idx = (
          torch.LongTensor(dataset.get_idx_split("test")) + paper_offset
      )
      label = dataset.paper_label
  
      print("Initializing data loader...")
      sampler = dgl.dataloading.MultiLayerNeighborSampler([160, 160])
      valid_collator = ExternalNodeCollator(
          g, valid_idx, sampler, paper_offset, feats, label
      )
      valid_dataloader = torch.utils.data.DataLoader(
          valid_collator.dataset,
          batch_size=16,
          shuffle=False,
          drop_last=False,
          collate_fn=valid_collator.collate,
          num_workers=2,
      )
      test_collator = ExternalNodeCollator(
          g, test_idx, sampler, paper_offset, feats, label
      )
      test_dataloader = torch.utils.data.DataLoader(
          test_collator.dataset,
          batch_size=16,
          shuffle=False,
          drop_last=False,
          collate_fn=test_collator.collate,
          num_workers=4,
      )
  
      print("Loading model...")
      model = RGAT(
          dataset.num_paper_features,
          dataset.num_classes,
          1024,
          5,
          2,
          4,
          0.5,
          "paper",
      ).cuda()
  
      # load ddp's model parameters, we need to remove the name of 'module.'
      state_dict = torch.load(args.model_path)
      new_state_dict = OrderedDict()
      for k, v in state_dict.items():
          name = k[7:]
          new_state_dict[name] = v
      model.load_state_dict(new_state_dict)
  
      model.eval()
      correct = total = 0
      for i, (input_nodes, output_nodes, mfgs) in enumerate(
          tqdm.tqdm(valid_dataloader)
      ):
          with torch.no_grad():
              mfgs = [g.to("cuda") for g in mfgs]
              x = mfgs[0].srcdata["x"]
              y = mfgs[-1].dstdata["y"]
              y_hat = model(mfgs, x)
              correct += (y_hat.argmax(1) == y).sum().item()
              total += y_hat.shape[0]
      acc = correct / total
      print("Validation accuracy:", acc)
      evaluator = MAG240MEvaluator()
      y_preds = []
      for i, (input_nodes, output_nodes, mfgs) in enumerate(
          tqdm.tqdm(test_dataloader)
      ):
          with torch.no_grad():
              mfgs = [g.to("cuda") for g in mfgs]
              x = mfgs[0].srcdata["x"]
              y = mfgs[-1].dstdata["y"]
              y_hat = model(mfgs, x)
              y_preds.append(y_hat.argmax(1).cpu())
      evaluator.save_test_submission(
          {"y_pred": torch.cat(y_preds)}, args.submission_path
      )
  
imports: import argparse
  import math
  import sys
  from collections import OrderedDict
  import dgl
  import dgl.nn
  import numpy
  import torch
  import torch.multiprocessing
  import torch.nn
  import torch.nn.functional
  import tqdm
  from ogb.lsc import MAG240MDataset, MAG240MEvaluator
  from torch.nn.parallel import DistributedDataParallel
label_desc: Use image node_id 2 for calling a global function with example usage: test(args, dataset, g, feats, paper_offset) without return types