View source on GitHub
|
Indicates whether the caller code is executing inside a tf.function.
tf.inside_function()
Returns | |
|---|---|
Boolean, True if the caller code is executing inside a tf.function
rather than eagerly.
|
Example:
tf.inside_function()False@tf.functiondef f():print(tf.inside_function())f()True
View source on GitHub