| @@ -21,6 +21,7 @@ | |||||
| #include "common/types.h" | #include "common/types.h" | ||||
| #include "common/util.h" | #include "common/util.h" | ||||
| #include "graph/passes/graph_builder_utils.h" | #include "graph/passes/graph_builder_utils.h" | ||||
| #include "graph/utils/attr_utils.h" | |||||
| #define private public | #define private public | ||||
| #define protected public | #define protected public | ||||
| @@ -34,19 +35,17 @@ namespace ge { | |||||
| class UtestGraphPreproces : public testing::Test { | class UtestGraphPreproces : public testing::Test { | ||||
| protected: | protected: | ||||
| void SetUp() { | void SetUp() { | ||||
| map<AscendString, AscendString> options; | |||||
| ge::Status ret = ge::GEInitialize(options); | |||||
| EXPECT_EQ(ret, ge::SUCCESS); | |||||
| } | } | ||||
| void TearDown() { | void TearDown() { | ||||
| ge::Status ret = ge::GEFinalize(); | |||||
| EXPECT_EQ(ret, ge::SUCCESS); | |||||
| } | } | ||||
| }; | }; | ||||
| ComputeGraphPtr BuildGraph1(){ | ComputeGraphPtr BuildGraph1(){ | ||||
| auto builder = ut::GraphBuilder("g1"); | auto builder = ut::GraphBuilder("g1"); | ||||
| auto data1 = builder.AddNode("data1",DATA,0,1); | auto data1 = builder.AddNode("data1",DATA,0,1); | ||||
| auto data_opdesc = data1->GetOpDesc(); | |||||
| AttrUtils::SetInt(data_opdesc, ATTR_NAME_INDEX, 0); | |||||
| data1->UpdateOpDesc(data_opdesc); | |||||
| return builder.GetGraph(); | return builder.GetGraph(); | ||||
| } | } | ||||
| @@ -66,6 +65,7 @@ TEST_F(UtestGraphPreproces, test_dynamic_input_shape_parse) { | |||||
| EXPECT_EQ(ret, ge::SUCCESS); | EXPECT_EQ(ret, ge::SUCCESS); | ||||
| // check data node output shape_range and shape | // check data node output shape_range and shape | ||||
| auto data_node = graph_prepare.compute_graph_->FindNode("data1"); | auto data_node = graph_prepare.compute_graph_->FindNode("data1"); | ||||
| ) | |||||
| auto data_output_desc = data_node->GetOpDesc()->GetOutputDescPtr(0); | auto data_output_desc = data_node->GetOpDesc()->GetOutputDescPtr(0); | ||||
| vector<int64_t> expect_shape = {3,-1,-1,5}; | vector<int64_t> expect_shape = {3,-1,-1,5}; | ||||
| auto result_shape = data_output_desc->GetShape(); | auto result_shape = data_output_desc->GetShape(); | ||||