diff --git a/tests/ut/ge/graph/preprocess/graph_preprocess_unittest.cc b/tests/ut/ge/graph/preprocess/graph_preprocess_unittest.cc index e8175f39..068ef5f4 100644 --- a/tests/ut/ge/graph/preprocess/graph_preprocess_unittest.cc +++ b/tests/ut/ge/graph/preprocess/graph_preprocess_unittest.cc @@ -21,6 +21,7 @@ #include "common/types.h" #include "common/util.h" #include "graph/passes/graph_builder_utils.h" +#include "graph/utils/attr_utils.h" #define private public #define protected public @@ -34,19 +35,17 @@ namespace ge { class UtestGraphPreproces : public testing::Test { protected: void SetUp() { - map options; - ge::Status ret = ge::GEInitialize(options); - EXPECT_EQ(ret, ge::SUCCESS); } void TearDown() { - ge::Status ret = ge::GEFinalize(); - EXPECT_EQ(ret, ge::SUCCESS); } }; ComputeGraphPtr BuildGraph1(){ auto builder = ut::GraphBuilder("g1"); 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(); } @@ -66,6 +65,7 @@ TEST_F(UtestGraphPreproces, test_dynamic_input_shape_parse) { EXPECT_EQ(ret, ge::SUCCESS); // check data node output shape_range and shape auto data_node = graph_prepare.compute_graph_->FindNode("data1"); +) auto data_output_desc = data_node->GetOpDesc()->GetOutputDescPtr(0); vector expect_shape = {3,-1,-1,5}; auto result_shape = data_output_desc->GetShape();