Stops the current trace and discards any collected information.
()
| 1222 | |
| 1223 | @tf_export("summary.trace_off", v1=[]) |
| 1224 | def trace_off(): |
| 1225 | """Stops the current trace and discards any collected information.""" |
| 1226 | global _current_trace_context |
| 1227 | with _current_trace_context_lock: |
| 1228 | _current_trace_context = None |
| 1229 | |
| 1230 | # Disabling run_metadata disables graph collection as well. |
| 1231 | context.context().disable_run_metadata() |
| 1232 | |
| 1233 | # profiler only has start and stop. One needs to stop in order to export |
| 1234 | # and stopping when it is not running will raise an error. |
| 1235 | try: |
| 1236 | _profiler.stop() |
| 1237 | except _profiler.ProfilerNotRunningError: |
| 1238 | pass |
no test coverage detected