Generate Chrome Trace snapshot event for a computed Tensor. Args: tensor: A 'TensorTracker' object. timestamp: The timestamp of this snapshot as a long integer. pid: The pid assigned for showing the device where this op ran. tid: The tid of the thread computing the tens
(self, tensor, timestamp, pid, tid, value)
| 604 | target_pid, target_tid, flow_id) |
| 605 | |
| 606 | def _emit_tensor_snapshot(self, tensor, timestamp, pid, tid, value): |
| 607 | """Generate Chrome Trace snapshot event for a computed Tensor. |
| 608 | |
| 609 | Args: |
| 610 | tensor: A 'TensorTracker' object. |
| 611 | timestamp: The timestamp of this snapshot as a long integer. |
| 612 | pid: The pid assigned for showing the device where this op ran. |
| 613 | tid: The tid of the thread computing the tensor snapshot. |
| 614 | value: A JSON-compliant snapshot of the object. |
| 615 | """ |
| 616 | desc = str(value.tensor_description).replace('"', '') |
| 617 | snapshot = {'tensor_description': desc} |
| 618 | self._chrome_trace.emit_obj_snapshot('Tensor', tensor.name, timestamp, pid, |
| 619 | tid, tensor.object_id, snapshot) |
| 620 | |
| 621 | def _produce_tensor(self, name, timestamp, tensors_pid, allocator, num_bytes): |
| 622 | object_id = len(self._tensors) |
no test coverage detected