Adds the given tensor to this graph and returns the captured tensor.
(self, tensor, name=None)
| 808 | dtypes=dtypes, **kwargs) |
| 809 | |
| 810 | def capture(self, tensor, name=None): |
| 811 | """Adds the given tensor to this graph and returns the captured tensor.""" |
| 812 | if tensor in self._captured: |
| 813 | # Captured already. |
| 814 | return self._captured[tensor] |
| 815 | elif self._capture_by_value: |
| 816 | return self._add_tensor_and_parents(tensor) |
| 817 | else: |
| 818 | return self._capture_tensor_as_extra_input(tensor, name) |
| 819 | |
| 820 | def _capture_tensor_as_extra_input(self, tensor, name=None): |
| 821 | # Substitute with a placeholder. |
no test coverage detected