ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more


Context-manager profile API.

Used in the notebooks

Used in the tutorials

Profiling will start when entering the scope, and stop and save the results to the logdir when exits the scope. Open TensorBoard profile tab to view results.

Example usage:

with tf.profiler.experimental.Profile("/path/to/logdir"):
  # do some work

logdir profile data will save to this directory.
options An optional tf.profiler.experimental.ProfilerOptions can be provided to fine tune the profiler's behavior.



View source


View source