code: def test():
      model.eval()
  
      y_true = {"train": [], "valid": [], "test": []}
      y_pred = {"train": [], "valid": [], "test": []}
  
      pbar = tqdm(total=len(test_loader))
      pbar.set_description(f"Evaluating epoch: {epoch:04d}")
  
      for data in test_loader:
          data = data.to(device)
          out = model(data.x, data.edge_index, data.edge_attr)
  
          for split in y_true.keys():
              mask = data[f"{split}_mask"]
              y_true[split].append(data.y[mask].cpu())
              y_pred[split].append(out[mask].cpu())
  
          pbar.update(1)
  
      pbar.close()
  
      train_rocauc = evaluator.eval(
          {
              "y_true": torch.cat(y_true["train"], dim=0),
              "y_pred": torch.cat(y_pred["train"], dim=0),
          }
      )["rocauc"]
  
      valid_rocauc = evaluator.eval(
          {
              "y_true": torch.cat(y_true["valid"], dim=0),
              "y_pred": torch.cat(y_pred["valid"], dim=0),
          }
      )["rocauc"]
  
      test_rocauc = evaluator.eval(
          {
              "y_true": torch.cat(y_true["test"], dim=0),
              "y_pred": torch.cat(y_pred["test"], dim=0),
          }
      )["rocauc"]
  
      return train_rocauc, valid_rocauc, test_rocauc
  
file_path: pytorch_geometric/examples/ogbn_proteins_deepgcn.py
imports: import torch
  import torch.nn.functional
  from ogb.nodeproppred import Evaluator, PygNodePropPredDataset
  from torch.nn import LayerNorm, Linear, ReLU
  from tqdm import tqdm
  from torch_geometric.loader import RandomNodeLoader
  from torch_geometric.nn import DeepGCNLayer, GENConv
  from torch_geometric.utils import scatter
label_desc: Use image node_id 2 for calling a global function with example usage: test() and returns: train_rocauc,  valid_rocauc,  test_rocauc