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

Function get_func_graph_output

tensorflow/python/ops/while_v2.py:790–800  ·  view source on GitHub ↗

Returns t or Identity(t) whichever exists in graph outputs else None.

(t)

Source from the content-addressed store, hash-verified

788 assert isinstance(tensor.graph, func_graph_module.FuncGraph)
789
790 def get_func_graph_output(t):
791 """Returns t or Identity(t) whichever exists in graph outputs else None."""
792 for output in tensor.graph.outputs:
793 if output is t:
794 return t
795 # tf.defun adds an Identity for each output, check whether that is the case.
796 identity_op = t.consumers()[0]
797 if (identity_op.type == "Identity" and
798 identity_op.outputs[0] in tensor.graph.outputs):
799 return identity_op.outputs[0]
800 return None
801
802 for consumer in tensor.consumers():
803 # Find the consumer that is a TensorListPushBack node whose TensorList input

Callers 1

_get_accumulatorFunction · 0.85

Calls 1

consumersMethod · 0.45

Tested by

no test coverage detected