code: def evaluate(loader):
      output = []
      step = 0
      while step < loader.steps_per_epoch:
          step += 1
          inputs, target = loader.__next__()
          pred = model(inputs, training=False)
          outs = (
              loss_fn(target, pred),
              tf.reduce_mean(categorical_accuracy(target, pred)),
              len(target),  # Keep track of batch size
          )
          output.append(outs)
          if step == loader.steps_per_epoch:
              output = np.array(output)
              return np.average(
                  output[:, :-1], 0, weights=output[:, -1]
              )
  
file_path: spektral/examples/graph_prediction/general_gnn.py
imports: import numpy
  import tensorflow
  from tensorflow.keras.losses import CategoricalCrossentropy
  from tensorflow.keras.metrics import categorical_accuracy
  from tensorflow.keras.optimizers import Adam
  from spektral.data import DisjointLoader
  from spektral.datasets import TUDataset
  from spektral.models import GeneralGNN
label_desc: Use image node_id 2 for calling a global function with example usage: evaluate(loader) and returns: np