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

Function AddPrefixes

tensorflow/core/graph/graph_constructor.cc:513–519  ·  view source on GitHub ↗

Adds any prefixes of `node_name` (not including the full name itself) to `prefixes`.

Source from the content-addressed store, hash-verified

511// Adds any prefixes of `node_name` (not including the full name itself) to
512// `prefixes`.
513void AddPrefixes(StringPiece node_name,
514 gtl::FlatSet<StringPiece, StringPieceHasher>* prefixes) {
515 size_t idx = -1;
516 while ((idx = node_name.find('/', idx + 1)) != StringPiece::npos) {
517 prefixes->insert(node_name.substr(0, idx));
518 }
519}
520
521Status GraphConstructor::EnsureNoNameCollisions() {
522 existing_nodes_.reserve(g_->num_nodes());

Callers 2

BuildNodeIndexMethod · 0.85

Calls 2

findMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected