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

Function _Consumers

tensorflow/python/ops/gradients_util.py:498–514  ·  view source on GitHub ↗

Returns the consumers of t, crossing closure boundaries where necessary. Args: t: Tensor func_graphs: a list of FuncGraphs that may have captured t. Returns: A list of tensors. The tensors will be from the current graph and/or func_graphs.

(t, func_graphs)

Source from the content-addressed store, hash-verified

496
497
498def _Consumers(t, func_graphs):
499 """Returns the consumers of t, crossing closure boundaries where necessary.
500
501 Args:
502 t: Tensor
503 func_graphs: a list of FuncGraphs that may have captured t.
504
505 Returns:
506 A list of tensors. The tensors will be from the current graph and/or
507 func_graphs.
508 """
509 consumers = t.consumers()
510 for func in func_graphs:
511 for input_t, placeholder in _Captures(func):
512 if input_t is t:
513 consumers.extend(_Consumers(placeholder, func_graphs))
514 return consumers
515
516
517def _GradientsHelper(ys,

Callers 1

_MarkReachedOpsFunction · 0.85

Calls 3

_CapturesFunction · 0.85
consumersMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected