Specifically, when using the code:
with tf.GradientTape() as tape: out = model(x, training=True) loss = tf.keras.losses.categorical_crossentropy(y