Browse Source

display model info

tags/v1.2.0
wangwenhua1@huawei.com 4 years ago
parent
commit
210ee03cd5
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      tests/ut/ge/session/omg_omg_unittest.cc

+ 15
- 0
tests/ut/ge/session/omg_omg_unittest.cc View File

@@ -31,8 +31,23 @@ class UTEST_omg_omg : public testing::Test {
void TearDown() override {}
};
TEST_F(UTEST_omg_omg, display_model_info_failed)
{
ge::proto::ModelDef model_def;
PrintModelInfo(&model_def);
}
TEST_F(UTEST_omg_omg, display_model_info_success)
{
ge::proto::ModelDef model_def;
auto attrs = model_def.mutable_attr();
ge::proto::AttrDef *attr_def_soc = &(*attrs)["soc_version"];
attr_def_soc->set_s("Ascend310");
ge::proto::AttrDef *attr_def = &(*attrs)["om_info_list"];
attr_def->mutable_list()->add_i(1);
attr_def->mutable_list()->add_i(2);
attr_def->mutable_list()->add_i(3);
attr_def->mutable_list()->add_i(4);
attr_def->mutable_list()->add_i(5);
PrintModelInfo(&model_def);
}

Loading…
Cancel
Save