code: def test(
      model, predictor, data, split_edge, evaluator, batch_size, device
  ):
      predictor.eval()
      print("Evaluating full-batch GNN on CPU...")
  
      weights = [
          (
              conv.lin.weight.t().cpu().detach().numpy(),
              conv.bias.cpu().detach().numpy(),
          )
          for conv in model.convs
      ]
      model = GCNInference(weights)
  
      x = data.x.numpy()
      adj = SparseTensor(row=data.edge_index[0], col=data.edge_index[1])
      adj = adj.set_diag()
      deg = adj.sum(dim=1)
      deg_inv_sqrt = deg.pow(-0.5)
      deg_inv_sqrt[deg_inv_sqrt == float("inf")] = 0
      adj = deg_inv_sqrt.view(-1, 1) * adj * deg_inv_sqrt.view(1, -1)
      adj = adj.to_scipy(layout="csr")
  
      h = torch.from_numpy(model(x, adj)).to(device)
  
      def test_split(split):
          source = split_edge[split]["source_node"].to(device)
          target = split_edge[split]["target_node"].to(device)
          target_neg = split_edge[split]["target_node_neg"].to(device)
  
          pos_preds = []
          for perm in DataLoader(range(source.size(0)), batch_size):
              src, dst = source[perm], target[perm]
              pos_preds += [predictor(h[src], h[dst]).squeeze().cpu()]
          pos_pred = torch.cat(pos_preds, dim=0)
  
          neg_preds = []
          source = source.view(-1, 1).repeat(1, 1000).view(-1)
          target_neg = target_neg.view(-1)
          for perm in DataLoader(range(source.size(0)), batch_size):
              src, dst_neg = source[perm], target_neg[perm]
              neg_preds += [
                  predictor(h[src], h[dst_neg]).squeeze().cpu()
              ]
          neg_pred = torch.cat(neg_preds, dim=0).view(-1, 1000)
  
          return (
              evaluator.eval(
                  {
                      "y_pred_pos": pos_pred,
                      "y_pred_neg": neg_pred,
                  }
              )["mrr_list"]
              .mean()
              .item()
          )
  
      train_mrr = test_split("eval_train")
      valid_mrr = test_split("valid")
      test_mrr = test_split("test")
  
      return train_mrr, valid_mrr, test_mrr
  
imports: import argparse
  import torch
  import numpy
  import torch.nn.functional
  from torch.utils.data import DataLoader
  from torch_sparse import SparseTensor
  from torch_geometric.data import ClusterData, ClusterLoader
  from torch_geometric.nn import GCNConv
  from torch_geometric.utils import to_undirected
  from ogb.linkproppred import PygLinkPropPredDataset, Evaluator
  from logger import Logger
label_desc: Use image node_id 2 for calling a global function with example usage: test(model, predictor, data, split_edge, evaluator, batch_size, device) and returns: train_mrr,  valid_mrr,  test_mrr, evaluator