code: def test(loader):
      model.eval()
  
      preds, targets = [], []
      for batch in tqdm.tqdm(loader):
          batch = batch.to(device)
  
          pred = (
              model(
                  batch.x_dict,
                  batch.edge_index_dict,
                  batch["user", "item"].edge_label_index,
              )
              .sigmoid()
              .view(-1)
              .cpu()
          )
          target = batch["user", "item"].edge_label.long().cpu()
  
          preds.append(pred)
          targets.append(target)
  
      pred = torch.cat(preds, dim=0).numpy()
      target = torch.cat(targets, dim=0).numpy()
  
      return roc_auc_score(target, pred)
  
imports: import os.path
  import torch
  import torch.nn.functional
  import tqdm
  from sklearn.metrics import roc_auc_score
  from torch.nn import Embedding, Linear
  import torch_geometric.transforms
  from torch_geometric.datasets import Taobao
  from torch_geometric.loader import LinkNeighborLoader
  from torch_geometric.nn import SAGEConv
  from torch_geometric.utils.convert import to_scipy_sparse_matrix
label_desc: Use image node_id 2 for calling a global function with example usage: test(loader) and returns: roc_auc_score