code: def evaluate(model, loader, node_embed, labels, category, device):
      model.eval()
      total_loss = 0
      total_acc = 0
      count = 0
      with loader.enable_cpu_affinity():
          for input_nodes, seeds, blocks in loader:
              blocks = [blk.to(device) for blk in blocks]
              seeds = seeds[category]
              emb = extract_embed(node_embed, input_nodes)
              emb = {k: e.to(device) for k, e in emb.items()}
              lbl = labels[seeds].to(device)
              logits = model(emb, blocks)[category]
              loss = F.cross_entropy(logits, lbl)
              acc = th.sum(logits.argmax(dim=1) == lbl).item()
              total_loss += loss.item() * len(seeds)
              total_acc += acc
              count += len(seeds)
      return total_loss / count, total_acc / count
  
file_path: dgl/examples/pytorch/rgcn-hetero/entity_classify_mb.py
imports: import argparse
  import itertools
  import time
  import dgl
  import numpy
  import torch
  import torch.nn.functional
  from dgl.data.rdf import AIFBDataset, AMDataset, BGSDataset, MUTAGDataset
  from model import EntityClassify, RelGraphEmbed
label_desc: Use image node_id 2 for calling a global function with example usage: evaluate(model, loader, node_embed, labels, category, device) and returns: unknown,  unknown