code: def evaluate(g, target_idx, labels, num_classes, test_mask, model):
      test_idx = torch.nonzero(test_mask, as_tuple=False).squeeze()
      model.eval()
      with torch.no_grad():
          logits = model(g)
      logits = logits[target_idx]
      return accuracy(
          logits[test_idx].argmax(dim=1),
          labels[test_idx],
          task="multiclass",
          num_classes=num_classes,
      ).item()
  
file_path: dgl/examples/pytorch/rgcn/entity.py
imports: import argparse
  import dgl
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.data.rdf import AIFBDataset, AMDataset, BGSDataset, MUTAGDataset
  from dgl.nn.pytorch import RelGraphConv
  from torchmetrics.functional import accuracy
label_desc: Use image node_id 1 for calling a global function with example usage: evaluate(g, target_idx, labels, num_classes, test_mask, model) and returns: accuracy