Returns whether the models we are testing should be run eagerly.
()
| 309 | |
| 310 | |
| 311 | def should_run_eagerly(): |
| 312 | """Returns whether the models we are testing should be run eagerly.""" |
| 313 | if _thread_local_data.run_eagerly is None: |
| 314 | raise ValueError('Cannot call `should_run_eagerly()` outside of a ' |
| 315 | '`run_eagerly_scope()` or `run_all_keras_modes` ' |
| 316 | 'decorator.') |
| 317 | |
| 318 | return _thread_local_data.run_eagerly and context.executing_eagerly() |
| 319 | |
| 320 | |
| 321 | @tf_contextlib.contextmanager |
no test coverage detected