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

Method GetNodeIndex

tensorflow/core/grappler/graph_topology_view.cc:180–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180const absl::optional<int> GraphTopologyView::GetNodeIndex(
181 const absl::string_view node_name) const {
182 DCHECK(is_initialized()) << "GraphTopologyView is not initialized";
183 const auto it = node_name_to_index_.find(node_name);
184 DCHECK(it != node_name_to_index_.end()) << "Node doesn't exist in a graph";
185 return it == node_name_to_index_.end() ? absl::nullopt
186 : absl::make_optional(it->second);
187}
188
189const absl::optional<int> GraphTopologyView::GetNodeIndex(
190 const NodeDef& node) const {

Callers 1

TEST_FFunction · 0.45

Calls 3

nameMethod · 0.65
findMethod · 0.45
endMethod · 0.45

Tested by 1

TEST_FFunction · 0.36