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

Function _get_intermediates

tensorflow/python/ops/cond_v2.py:450–463  ·  view source on GitHub ↗

Returns intermediate tensors of `func_graph` for gradient computation.

(func_graph)

Source from the content-addressed store, hash-verified

448
449
450def _get_intermediates(func_graph):
451 """Returns intermediate tensors of `func_graph` for gradient computation."""
452 intermediates = []
453 for op in func_graph.get_operations():
454 for t in op.outputs:
455 if t in func_graph.inputs: continue
456 if t in func_graph.outputs: continue
457 if t.dtype is dtypes.resource:
458 continue
459 # Accumulating mutexes can cause deadlock.
460 if op.type == "MutexLock":
461 continue
462 intermediates.append(t)
463 return intermediates
464
465
466def _make_intermediates_match(branch_graphs, branch_optionals):

Callers 1

_build_condFunction · 0.70

Calls 2

get_operationsMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected