code: def evaluate(model, labels, dataloader, inv_target):
      model.eval()
      eval_logits = []
      eval_seeds = []
      with torch.no_grad():
          for _, output_nodes, blocks in dataloader:
              output_nodes = inv_target[output_nodes.type(torch.int64)]
              logits = model(blocks)
              eval_logits.append(logits.cpu().detach())
              eval_seeds.append(output_nodes.cpu().detach())
      num_classes = eval_logits[0].shape[1]
      eval_logits = torch.cat(eval_logits)
      eval_seeds = torch.cat(eval_seeds)
      return accuracy(
          eval_logits.argmax(dim=1),
          labels[eval_seeds].cpu(),
          task="multiclass",
          num_classes=num_classes,
      ).item()
  
file_path: dgl/examples/advanced/cugraph/rgcn.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.dataloading import DataLoader, MultiLayerNeighborSampler
  from dgl.nn import CuGraphRelGraphConv
  from torchmetrics.functional import accuracy
label_desc: Use image node_id 1 for calling a global function with example usage: evaluate(model, labels, dataloader, inv_target) and returns: accuracy