code: def train_on_batch(inputs, target):
      with tf.GradientTape() as tape:
          predictions = model(inputs, training=True)
          loss = loss_fn(target, predictions) + sum(model.losses)
          acc = tf.reduce_mean(
              sparse_categorical_accuracy(target, predictions)
          )
  
      gradients = tape.gradient(loss, model.trainable_variables)
      optimizer.apply_gradients(
          zip(gradients, model.trainable_variables)
      )
      return loss, acc
  
file_path: spektral/examples/other/graph_signal_classification_mnist.py
imports: import numpy
  import tensorflow
  from tensorflow.keras import Model
  from tensorflow.keras.layers import Dense
  from tensorflow.keras.losses import SparseCategoricalCrossentropy
  from tensorflow.keras.metrics import sparse_categorical_accuracy
  from tensorflow.keras.optimizers import Adam
  from tensorflow.keras.regularizers import l2
  from spektral.data import MixedLoader
  from spektral.datasets.mnist import MNIST
  from spektral.layers import GCNConv, GlobalSumPool
  from spektral.utils.sparse import sp_matrix_to_sp_tensor
label_desc: Use image node_id 1 for calling a global function with example usage: train_on_batch(inputs, target) and returns: loss,  acc