Disables eager execution. This function can only be called before any Graphs, Ops, or Tensors have been created. It can be used at the beginning of the program for complex migration projects from TensorFlow 1.x to 2.x.
()
| 5801 | |
| 5802 | @tf_export(v1=["disable_eager_execution"]) |
| 5803 | def disable_eager_execution(): |
| 5804 | """Disables eager execution. |
| 5805 | |
| 5806 | This function can only be called before any Graphs, Ops, or Tensors have been |
| 5807 | created. It can be used at the beginning of the program for complex migration |
| 5808 | projects from TensorFlow 1.x to 2.x. |
| 5809 | """ |
| 5810 | _api_usage_gauge.get_cell().set(False) |
| 5811 | context.default_execution_mode = context.GRAPH_MODE |
| 5812 | c = context.context_safe() |
| 5813 | if c is not None: |
| 5814 | c._thread_local_data.is_eager = False # pylint: disable=protected-access |
| 5815 | |
| 5816 | |
| 5817 | def enable_eager_execution_internal(config=None, |