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

Method AddNode

tensorflow/core/graph/graph.cc:433–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431void Graph::set_versions(const VersionDef& versions) { *versions_ = versions; }
432
433Node* Graph::AddNode(NodeDef node_def, Status* status) {
434 const OpDef* op_def;
435 status->Update(ops_.LookUpOpDef(node_def.op(), &op_def));
436 if (!status->ok()) return nullptr;
437
438 DataTypeVector inputs;
439 DataTypeVector outputs;
440 status->Update(InOutTypesForNode(node_def, *op_def, &inputs, &outputs));
441 if (!status->ok()) {
442 *status = AttachDef(*status, node_def);
443 return nullptr;
444 }
445
446 Node* node = AllocateNode(std::make_shared<NodeProperties>(
447 op_def, std::move(node_def), inputs, outputs),
448 nullptr);
449 return node;
450}
451
452Node* Graph::CopyNode(const Node* node) {
453 DCHECK(!node->IsSource());

Callers 15

ReplaceNodeFunction · 0.45
Create1DStringConstOpFunction · 0.45
CreateRestoreOpFunction · 0.45
CreateDefaultValueNodeFunction · 0.45
AddPlaceholderFunction · 0.45
CreateRestoreAllNodeFunction · 0.45
CreateFakeConstOpFunction · 0.45

Calls 6

InOutTypesForNodeFunction · 0.85
AttachDefFunction · 0.85
LookUpOpDefMethod · 0.80
UpdateMethod · 0.45
opMethod · 0.45
okMethod · 0.45

Tested by 13

TESTFunction · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36
MakeCgmodeCompiledKernelFunction · 0.36
MakeOuterGraphFunction · 0.36
MakeXlaCompiledKernelFunction · 0.36
MakeCallFunction · 0.36
TEST_FFunction · 0.36
FromNodeDefMethod · 0.36
TESTFunction · 0.36