Skip to content
masterclass Buddy

TensorFlow · Class

GradientTape

tf.GradientTape records TensorFlow operations and computes gradients automatically. It tracks trainable variables by default, while other tensors need watch().

Last updated

Syntax

tf.GradientTape(persistent=False, watch_accessed_variables=True)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • tf.autodiff.GradientTape
  • tf.UnconnectedGradients
  • GradientTape.gradient
  • GradientTape.jacobian
  • GradientTape.batch_jacobian
  • GradientTape.watch
  • GradientTape.reset
  • GradientTape.stop_recording

Source: tf.GradientTape | TensorFlow v2.21.0. Checked 2026-11-03.