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

Method _get_min_depth

tensorflow/python/keras/engine/network.py:1549–1562  ·  view source on GitHub ↗

Gets the minimum depth at which node can be computed.

(node)

Source from the content-addressed store, hash-verified

1547 network_nodes = set(relevant_nodes + list(node_to_depth.keys()))
1548
1549 def _get_min_depth(node):
1550 """Gets the minimum depth at which node can be computed."""
1551 min_depth = 0
1552 for layer, node_id, _, _ in node.iterate_inbound(include_arguments=True):
1553 inbound_node = layer._inbound_nodes[node_id]
1554 if inbound_node in node_to_depth:
1555 min_depth = min(min_depth, node_to_depth[inbound_node])
1556 elif inbound_node not in network_nodes:
1557 continue
1558 else:
1559 # Previous relevant nodes haven't been processed yet.
1560 return None
1561 # New node is one shallower than its shallowest input.
1562 return min_depth - 1
1563
1564 # Insert nodes into `_nodes_by_depth` and other node attrs.
1565 unprocessed_nodes = copy.copy(relevant_nodes)

Callers

nothing calls this directly

Calls 2

iterate_inboundMethod · 0.80
minFunction · 0.50

Tested by

no test coverage detected