code: def test(model, device, data_loader, evaluator):
      model.eval()
      y_true, y_pred = [], []
  
      for g, labels in data_loader:
          g = g.to(device)
          logits = model(g, g.edata["feat"], g.ndata["feat"])
          y_true.append(labels.detach().cpu())
          y_pred.append(logits.detach().cpu())
  
      y_true = torch.cat(y_true, dim=0).numpy()
      y_pred = torch.cat(y_pred, dim=0).numpy()
  
      return evaluator.eval({"y_true": y_true, "y_pred": y_pred})[
          "rocauc"
      ]
  
file_path: dgl/examples/pytorch/deepergcn/main.py
imports: import argparse
  import copy
  import time
  import torch
  import torch.nn
  import torch.optim
  from models import DeeperGCN
  from ogb.graphproppred import collate_dgl, DglGraphPropPredDataset, Evaluator
  from torch.utils.data import DataLoader
label_desc: Use image node_id 2 for calling a global function with example usage: test(model, device, data_loader, evaluator) and returns: evaluator