MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / capture

Method capture

tensorflow/python/framework/function.py:810–818  ·  view source on GitHub ↗

Adds the given tensor to this graph and returns the captured tensor.

(self, tensor, name=None)

Source from the content-addressed store, hash-verified

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.

Callers 7

create_opMethod · 0.95
_op_to_colocate_withFunction · 0.45
func_graph_from_py_funcFunction · 0.45
_copy_sourceFunction · 0.45
_lift_single_variableFunction · 0.45

Tested by

no test coverage detected