code: def eval(model, test_graph, sku_info):
      preds, labels = [], []
      for edge in test_graph:
          src = th.tensor(sku_info[edge.src.numpy()[0]]).view(1, 4)
          dst = th.tensor(sku_info[edge.dst.numpy()[0]]).view(1, 4)
          # (1, dim)
          src = model.query_node_embed(src)
          dst = model.query_node_embed(dst)
          # (1, dim) -> (1, dim) -> (1, )
          logit = th.sigmoid(th.sum(src * dst))
          preds.append(logit.detach().numpy().tolist())
          labels.append(edge.label)
  
      fpr, tpr, thresholds = metrics.roc_curve(
          labels, preds, pos_label=1
      )
  
      print(
          "Evaluate link prediction AUC: {:.4f}".format(
              metrics.auc(fpr, tpr)
          )
      )
  
file_path: dgl/examples/pytorch/eges/main.py
imports: import dgl
  import torch
  import torch.optim
  import utils
  from model import EGES
  from sampler import Sampler
  from sklearn import metrics
  from torch.utils.data import DataLoader
label_desc: Use image node_id 2 for calling a global function with example usage: eval(model, test_graph, sku_info) without return types