Avoid creating Context with executing_eagerly()
This is just a small step in the direction of cleaning up some of these calls. In general, we need to avoid implicitly creating a context unless the caller really wanted to. PiperOrigin-RevId: 239229861
This commit is contained in:
parent
30af2e9ee1
commit
067a3a6c3f
@ -1025,6 +1025,9 @@ def executing_eagerly():
|
||||
but may also be enabled within the context of a Python function via
|
||||
tf.contrib.eager.py_func.
|
||||
"""
|
||||
if context_safe() is None:
|
||||
return default_execution_mode == EAGER_MODE
|
||||
|
||||
return context().executing_eagerly()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user