code: def evaluate(
      model,
      valid_exe,
      valid_ds,
      valid_prog,
      dev_count,
      evaluator,
      phase,
  ):
      """evaluate"""
      cc = 0
      scores = []
      labels = []
  
      for feed_dict in tqdm.tqdm(
          multi_device(valid_ds.generator(), dev_count),
          desc="evaluating",
      ):
          if dev_count > 1:
              output = valid_exe.run(
                  feed=feed_dict,
                  fetch_list=[model.logits, model.labels],
              )
          else:
              output = valid_exe.run(
                  valid_prog,
                  feed=feed_dict,
                  fetch_list=[model.logits, model.labels],
              )
          scores.append(output[0])
          labels.append(output[1])
  
      scores = np.vstack(scores)
      labels = np.vstack(labels)
      ret = evaluator.eval(scores, labels, phase)
      return ret
  
file_path: PGL/ogb_examples/linkproppred/ogbl-ppa/monitor/train_monitor.py
imports: import tqdm
  import json
  import numpy
  import sys
  import os
  import paddle.fluid
  from pgl.utils.log_writer import LogWriter
  from ogb.linkproppred import Evaluator
  from ogb.linkproppred import LinkPropPredDataset
label_desc: Use image node_id 2 for calling a global function with example usage: evaluate(model, valid_exe, valid_ds, valid_prog, dev_count, evaluator, phase) and returns: ret