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

Function AddNode

tensorflow/core/grappler/optimizers/data/graph_utils.cc:103–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103NodeDef* AddNode(StringPiece name, StringPiece op,
104 const std::vector<string>& inputs,
105 const std::vector<std::pair<string, AttrValue>>& attributes,
106 MutableGraphView* graph) {
107 NodeDef node;
108 if (!name.empty()) {
109 node.set_name(string(name));
110 } else {
111 SetUniqueGraphNodeName(op, graph->graph(), &node);
112 }
113 node.set_op(string(op));
114 for (const string& input : inputs) {
115 node.add_input(input);
116 }
117 for (auto attr : attributes) {
118 (*node.mutable_attr())[attr.first] = attr.second;
119 }
120 return graph->AddNode(std::move(node));
121}
122
123template <>
124NodeDef* AddScalarConstNode(bool v, MutableGraphView* graph) {

Callers 15

SetupGrapplerItemFunction · 0.70
TESTFunction · 0.70
TESTFunction · 0.70
TESTFunction · 0.70
TESTFunction · 0.70
TESTFunction · 0.70
MakeUnaryNodeFunction · 0.70
MakeUnaryNonConstNodeFunction · 0.70
MakeCacheNodeFunction · 0.70
MakeRangeNodeFunction · 0.70
SetUpMethod · 0.50

Calls 7

SetUniqueGraphNodeNameFunction · 0.85
set_opMethod · 0.80
emptyMethod · 0.45
set_nameMethod · 0.45
graphMethod · 0.45
add_inputMethod · 0.45
AddNodeMethod · 0.45

Tested by 15

SetupGrapplerItemFunction · 0.56
TESTFunction · 0.56
TESTFunction · 0.56
TESTFunction · 0.56
TESTFunction · 0.56
TESTFunction · 0.56
MakeUnaryNodeFunction · 0.56
MakeUnaryNonConstNodeFunction · 0.56
MakeCacheNodeFunction · 0.56
MakeRangeNodeFunction · 0.56
SetUpMethod · 0.40
TEST_FFunction · 0.40