Returns a RunMetadata proto with accumulated information. The returned protocol buffer contains information since the most recent call to either enable_run_metadata or export_run_metadata. Returns: A RunMetadata protocol buffer. Or None if not enabled.
(self)
| 1451 | pywrap_tensorflow.TFE_ContextDisableGraphCollection(self._context_handle) |
| 1452 | |
| 1453 | def export_run_metadata(self): |
| 1454 | """Returns a RunMetadata proto with accumulated information. |
| 1455 | |
| 1456 | The returned protocol buffer contains information since the most recent call |
| 1457 | to either enable_run_metadata or export_run_metadata. |
| 1458 | |
| 1459 | Returns: |
| 1460 | A RunMetadata protocol buffer. Or None if not enabled. |
| 1461 | """ |
| 1462 | if not self._context_handle: |
| 1463 | return None |
| 1464 | with c_api_util.tf_buffer() as buffer_: |
| 1465 | pywrap_tensorflow.TFE_ContextExportRunMetadata( |
| 1466 | self._context_handle, buffer_) |
| 1467 | proto_data = pywrap_tensorflow.TF_GetBuffer(buffer_) |
| 1468 | run_metadata = config_pb2.RunMetadata() |
| 1469 | run_metadata.ParseFromString(compat.as_bytes(proto_data)) |
| 1470 | return run_metadata |
| 1471 | |
| 1472 | @property |
| 1473 | def context_switches(self): |