tf.profiler.experimental.Profile
Context-manager profile API.
tf.profiler.experimental.Profile( logdir, options=None )
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.ProfilerOptions can be provided to fine tune the profiler's behavior. |
Methods
__enter__
__enter__()
__exit__
__exit__( typ, value, tb )
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/python/tf/profiler/experimental/Profile