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

Function _as_graph_element

tensorflow/python/framework/ops.py:183–196  ·  view source on GitHub ↗

Convert `obj` to a graph element if possible, otherwise return `None`. Args: obj: Object to convert. Returns: The result of `obj._as_graph_element()` if that method is available; otherwise `None`.

(obj)

Source from the content-addressed store, hash-verified

181
182
183def _as_graph_element(obj):
184 """Convert `obj` to a graph element if possible, otherwise return `None`.
185
186 Args:
187 obj: Object to convert.
188
189 Returns:
190 The result of `obj._as_graph_element()` if that method is available;
191 otherwise `None`.
192 """
193 conv_fn = getattr(obj, "_as_graph_element", None)
194 if conv_fn and callable(conv_fn):
195 return conv_fn()
196 return None
197
198
199_TENSOR_LIKE_TYPES = tuple()

Callers 2

_get_graph_from_inputsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected