code: def train_step(x, y):
      with tf.GradientTape() as tape:
          logits = model(x, training=True)
          loss_value = loss_fn(y, logits)
      grads = tape.gradient(loss_value, model.trainable_weights)
      optimizer.apply(grads, model.trainable_weights)
      train_acc_metric.update_state(y, logits)
      return loss_value
  
file_path: keras/guides/writing_a_custom_training_loop_in_tensorflow.py
imports: import time
  import os
  import tensorflow
  import keras
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: train_step(x, y) and returns: loss_value