code: def evaluate_network(model, data_loader):
      model.eval()
      epoch_loss = 0
      loss_fn = nn.BCEWithLogitsLoss()
      with th.no_grad():
          list_scores = []
          list_labels = []
          for (
              batch_labels,
              attn_mask,
              node_feat,
              in_degree,
              out_degree,
              path_data,
              dist,
          ) in data_loader:
              device = accelerator.device
  
              batch_scores = model(
                  node_feat.to(device),
                  in_degree.to(device),
                  out_degree.to(device),
                  path_data.to(device),
                  dist.to(device),
                  attn_mask=attn_mask,
              )
  
              # Gather all predictions and targets.
              (
                  all_predictions,
                  all_targets,
              ) = accelerator.gather_for_metrics(
                  (batch_scores, batch_labels)
              )
              loss = loss_fn(all_predictions, all_targets.float())
  
              epoch_loss += loss.item()
              list_scores.append(all_predictions)
              list_labels.append(all_targets)
  
          epoch_loss /= len(data_loader)
  
          evaluator = Evaluator(name="ogbg-molhiv")
          epoch_auc = evaluator.eval(
              {
                  "y_pred": th.cat(list_scores),
                  "y_true": th.cat(list_labels),
              }
          )["rocauc"]
  
      return epoch_loss, epoch_auc
  
file_path: dgl/examples/core/Graphormer/main.py
imports: import argparse
  import random
  import torch
  import torch.nn
  from accelerate import Accelerator
  from dataset import MolHIVDataset
  from dgl.data import download
  from dgl.dataloading import GraphDataLoader
  from model import Graphormer
  from ogb.graphproppred import Evaluator
  from transformers.optimization import AdamW, get_polynomial_decay_schedule_with_warmup
label_desc: Use image node_id 2 for calling a global function with example usage: evaluate_network(model, data_loader) and returns: epoch_loss,  epoch_auc