Browse Source

display model info

tags/v1.2.0
wangwenhua1@huawei.com 3 years ago
parent
commit
e3063461eb
3 changed files with 8 additions and 11 deletions
  1. +2
    -4
      tests/ut/ge/CMakeLists.txt
  2. +2
    -2
      tests/ut/ge/graph/load/model_helper_unittest.cc
  3. +4
    -5
      tests/ut/ge/session/omg_omg_unittest.cc

+ 2
- 4
tests/ut/ge/CMakeLists.txt View File

@@ -338,7 +338,7 @@ set(COMMON_FORMAT_SRC_FILES
"${GE_CODE_DIR}/ge/common/formats/format_transfers/format_transfer_fracz_nchw.cc"
"${GE_CODE_DIR}/ge/common/formats/format_transfers/format_transfer_fracz_nhwc.cc"
"${GE_CODE_DIR}/ge/common/formats/format_transfers/format_transfer_fracz_hwcn.cc"
"${GE_CODE_DIR}/ge/common/formats/utils/formats_trans_utils.cc"
"${GE_CODE_DIR}/ge/common/formats/utils/formats_trans_utils.cc"
)

set(GRAPH_OPTIMIZE_COMMON_SRC_FILES
@@ -406,7 +406,6 @@ set(DISTINCT_GRAPH_LOAD_SRC_FILES
"${GE_CODE_DIR}/ge/graph/load/new_model_manager/task_info/super_kernel/super_kernel.cc"
"${GE_CODE_DIR}/ge/graph/load/new_model_manager/task_info/super_kernel/super_kernel_factory.cc"
"${GE_CODE_DIR}/ge/model/ge_model.cc"
"${GE_CODE_DIR}/ge/common/helper/model_helper.cc"
"${GE_CODE_DIR}/ge/common/helper/om_file_helper.cc"
"${GE_CODE_DIR}/ge/common/debug/memory_dumper.cc"
"${GE_CODE_DIR}/ge/executor/ge_executor.cc"
@@ -437,7 +436,6 @@ set(GRAPH_BUILD_COMMON_SRC_FILES
"${GE_CODE_DIR}/ge/graph/build/memory/hybrid_mem_assigner.cc"
"${GE_CODE_DIR}/ge/graph/build/memory/max_block_mem_assigner.cc"
"${GE_CODE_DIR}/ge/model/ge_model.cc"
"${GE_CODE_DIR}/ge/common/helper/model_helper.cc"
"${GE_CODE_DIR}/ge/common/helper/om_file_helper.cc"
"${GE_CODE_DIR}/ge/common/tbe_kernel_store.cc"
"${GE_CODE_DIR}/ge/common/thread_pool.cc"
@@ -576,6 +574,7 @@ set(DISTINCT_GRAPH_LOAD_TEST_FILES
"graph/load/tbe_handle_store_unittest.cc"
#"graph/graph_load_unittest.cc"
"graph/ge_executor_unittest.cc"
"graph/load/model_helper_unittest.cc"
)

set(PASS_TEST_FILES
@@ -678,7 +677,6 @@ set(MULTI_PARTS_TEST_FILES
"common/format_transfer_fracz_nhwc_unittest.cc"
"common/format_transfer_fracz_hwcn_unittest.cc"
"common/ge_format_util_unittest.cc"
"common/model_helper_unittest.cc"
"graph/variable_accelerate_ctrl_unittest.cc"
"graph/build/logical_stream_allocator_unittest.cc"
"graph/build/mem_assigner_unittest.cc"


tests/ut/ge/common/model_helper_unittest.cc → tests/ut/ge/graph/load/model_helper_unittest.cc View File

@@ -24,10 +24,9 @@
#include "proto/task.pb.h"
using namespace ge;
using namespace std;
namespace ge {
class UtestModelHelper : public testing::Test {
protected:
void SetUp() override {}
@@ -50,3 +49,4 @@ TEST_F(UtestModelHelper, save_size_to_modeldef)
ModelHelper model_helper;
EXPECT_EQ(SUCCESS, model_helper.SaveSizeToModelDef(ge_model));
}
} // namespace ge

+ 4
- 5
tests/ut/ge/session/omg_omg_unittest.cc View File

@@ -21,9 +21,9 @@
#include "inc/framework/omg/omg.h"
using namespace ge;
using namespace std;
namespace ge {
class UtestOmg : public testing::Test {
protected:
void SetUp() override {}
@@ -31,14 +31,12 @@ class UtestOmg : public testing::Test {
void TearDown() override {}
};
TEST_F(UtestOmg, display_model_info_failed)
{
TEST_F(UtestOmg, display_model_info_failed) {
ge::proto::ModelDef model_def;
PrintModelInfo(&model_def);
}
TEST_F(UtestOmg, display_model_info_success)
{
TEST_F(UtestOmg, display_model_info_success) {
ge::proto::ModelDef model_def;
auto attrs = model_def.mutable_attr();
ge::proto::AttrDef *attr_def_soc = &(*attrs)["soc_version"];
@@ -51,3 +49,4 @@ TEST_F(UtestOmg, display_model_info_success)
attr_def->mutable_list()->add_i(5);
PrintModelInfo(&model_def);
}
} // namespace ge

Loading…
Cancel
Save