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

Function _MaybeCaptured

tensorflow/python/ops/gradients_util.py:433–449  ·  view source on GitHub ↗

If t is a captured value placeholder, returns the original captured value. Args: t: Tensor Returns: A tensor, potentially from a different Graph/FuncGraph.

(t)

Source from the content-addressed store, hash-verified

431
432
433def _MaybeCaptured(t):
434 """If t is a captured value placeholder, returns the original captured value.
435
436 Args:
437 t: Tensor
438
439 Returns:
440 A tensor, potentially from a different Graph/FuncGraph.
441 """
442 # pylint: disable=protected-access
443 if (not isinstance(t, ops.EagerTensor) and
444 _IsFunction(t.op.graph) and t.op.type == "Placeholder"):
445 for input_t, placeholder_t in _Captures(t.op.graph):
446 if t is placeholder_t:
447 return _MaybeCaptured(input_t)
448 # pylint: enable=protected-access
449 return t
450
451
452def _NonEagerInputs(op, xs_set):

Callers 1

_InputsFunction · 0.85

Calls 2

_IsFunctionFunction · 0.85
_CapturesFunction · 0.85

Tested by

no test coverage detected