tf.profiler.experimental.Profile  |  TensorFlow v2.16.1 (original) (raw)

tf.profiler.experimental.Profile

Context-manager profile API.

tf.profiler.experimental.Profile(
    logdir, options=None
)

Used in the notebooks

Used in the tutorials
TFF simulations with accelerators

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
Args
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.

Methods

__enter__

View source

__enter__()

__exit__

View source

__exit__(
    typ, value, tb
)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.

Last updated 2024-04-26 UTC.