code: def evaluate(model, dataset, device):
      model.eval()
      dataloader = create_dataloader(dataset, device, is_train=False)
  
      logits = []
      labels = []
      for step, data in enumerate(dataloader):
          # Get node pairs with labels for loss calculation.
          compacted_pairs, label = data.node_pairs_with_labels
  
          # The features of sampled nodes.
          x = data.node_features["feat"]
  
          # Forward.
          y = model(data.blocks, x)
          logit = (
              model.predictor(
                  y[compacted_pairs[0].long()]
                  * y[compacted_pairs[1].long()]
              )
              .squeeze()
              .detach()
          )
  
          logits.append(logit)
          labels.append(label)
  
      logits = torch.cat(logits, dim=0)
      labels = torch.cat(labels, dim=0)
  
      # Compute the AUROC score.
      metric = BinaryAUROC()
      metric.update(logits, labels)
      score = metric.compute().item()
      print(f"AUC: {score:.3f}")
  
file_path: dgl/examples/sampling/graphbolt/quickstart/link_prediction.py
imports: import dgl.graphbolt
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.nn import SAGEConv
  from torcheval.metrics import BinaryAUROC
label_desc: Use image node_id 2 for calling a global function with example usage: evaluate(model, dataset, device) without return types