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

Method BuildGraphInMap

tensorflow/core/grappler/graph_analyzer/gen_node.cc:30–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28GenNode::GenNode(const NodeDef* node) : node_(node), op_(nullptr) {}
29
30Status GenNode::BuildGraphInMap(const GraphDef& source, GenNodeMap* map) {
31 for (const auto& n : source.node()) {
32 const string& name = n.name();
33 if (map->find(name) != map->end()) {
34 // This error code looks more meaningful than ALREADY_EXISTS.
35 return Status(error::INVALID_ARGUMENT,
36 "Duplicate node name '" + name + "'.");
37 }
38 (*map)[name] = absl::make_unique<GenNode>(&n);
39 }
40 // Now parse the links.
41 for (const auto& mapit : *map) {
42 Status st = mapit.second->ParseInputs(map);
43 if (!st.ok()) {
44 return st;
45 }
46 }
47 return Status::OK();
48}
49
50Status GenNode::ParseInputs(const GenNodeMap* map) {
51 all_inputs_or_none_ = false;

Callers

nothing calls this directly

Calls 7

ParseInputsMethod · 0.80
nameMethod · 0.65
StatusClass · 0.50
nodeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected