MCPcopy Create free account
hub / github.com/OAID/Tengine / create_graph_node

Function create_graph_node

core/lib/tengine_c_api.cpp:619–661  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

617}
618
619node_t create_graph_node(graph_t graph, const char* node_name, const char* op_name)
620{
621 GraphExecutor* executor = reinterpret_cast<GraphExecutor*>(graph);
622
623 if(executor->PrerunDone())
624 {
625 set_tengine_errno(EACCES);
626 return nullptr;
627 }
628
629 Graph* real_graph = executor->GetGraph();
630
631 /* check if duplicate name */
632 if(real_graph->FindNode(node_name))
633 {
634 set_tengine_errno(EEXIST);
635 return nullptr;
636 }
637
638 Operator* op = OpManager::CreateOp(op_name);
639
640 if(op == nullptr)
641 {
642 set_tengine_errno(ENOENT);
643 return nullptr;
644 }
645
646 Node* new_node = new Node(node_name);
647
648 if(new_node == nullptr)
649 {
650 set_tengine_errno(ENOMEM);
651 return new_node;
652 }
653
654 new_node->SetOp(op);
655
656 real_graph->AddNode(new_node);
657
658 new_node->SetAttr(ATTR_API_GRAPH, executor);
659
660 return new_node;
661}
662
663node_t get_graph_node(graph_t graph, const char* node_name)
664{

Callers 15

create_input_nodeFunction · 0.85
create_pool_nodeFunction · 0.85
create_input_nodeFunction · 0.85
create_test_nodeFunction · 0.85
create_input_nodeFunction · 0.85
create_conv_nodeFunction · 0.85
create_input_nodeFunction · 0.85
create_test_nodeFunction · 0.85
create_input_nodeFunction · 0.85
create_test_nodeFunction · 0.85
create_input_nodeFunction · 0.85
create_test_nodeFunction · 0.85

Calls 7

set_tengine_errnoFunction · 0.85
PrerunDoneMethod · 0.80
SetOpMethod · 0.80
AddNodeMethod · 0.80
GetGraphMethod · 0.45
FindNodeMethod · 0.45
SetAttrMethod · 0.45

Tested by 15

create_input_nodeFunction · 0.68
create_test_nodeFunction · 0.68
create_input_nodeFunction · 0.68
create_conv_nodeFunction · 0.68
create_input_nodeFunction · 0.68
create_test_nodeFunction · 0.68
create_input_nodeFunction · 0.68
create_test_nodeFunction · 0.68
create_input_nodeFunction · 0.68
create_test_nodeFunction · 0.68
create_input_nodeFunction · 0.68
create_conv_nodeFunction · 0.68