Browse Source

display model info

pull/688/head
wangwenhua1@huawei.com 5 years ago
parent
commit
df5f18c9ba
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      ge/generator/ge_generator.cc

+ 9
- 1
ge/generator/ge_generator.cc View File

@@ -538,10 +538,18 @@ bool GeGenerator::Impl::SetOmSystemInfo(AttrHolder &obj) {
GELOGW("SetStr of soc_version failed.");
return false;
}

// 0(Caffe) 1(MindSpore) 3(TensorFlow) 5(Onnx)
std::map<string, string> framework_type_to_string = {
{"0", "Caffe"},
{"1", "MindSpore"},
{"3", "TensorFlow"},
{"5", "Onnx"}
};
std::string framework_type;
(void)ge::GetContext().GetOption(ge::FRAMEWORK_TYPE, framework_type);
GELOGI("SetOmSystemInfo framework_type: %s", framework_type.c_str());
if (!ge::AttrUtils::SetStr(obj, "framework_type", framework_type)) {
if (!ge::AttrUtils::SetStr(obj, "framework_type", framework_type_to_string[framework_type.c_str()])) {
GELOGW("SetStr of framework_type failed.");
return false;
}


Loading…
Cancel
Save