Browse Source

Fix st.

tags/v1.5.1
zhaozhixuan 4 years ago
parent
commit
8a1ec97399
3 changed files with 3 additions and 20 deletions
  1. +2
    -9
      ge/session/omg.cc
  2. +1
    -2
      inc/framework/omg/omg.h
  3. +0
    -9
      tests/ut/ge/session/omg_omg_unittest.cc

+ 2
- 9
ge/session/omg.cc View File

@@ -220,14 +220,7 @@ static Status ParseOutputFp16NodesFormat(const string &is_output_fp16) {
return SUCCESS;
}

void FindParserSo(const string &path, vector<string> &file_list,
string &caffe_parser_path, uint32_t recursive_depth) {
static const uint32_t max_recursive_depth = 20; // For recursive depth protection

if (recursive_depth >= max_recursive_depth) {
GELOGW("Recursive depth is become %u, Please check input!", recursive_depth);
return;
}
void FindParserSo(const string &path, vector<string> &file_list, string &caffe_parser_path) {
// path, Change to absolute path
string real_path = RealPath(path.c_str());
if (real_path.empty()) { // plugin path does not exist
@@ -264,7 +257,7 @@ void FindParserSo(const string &path, vector<string> &file_list,
continue;
}

FindParserSo(full_name, file_list, caffe_parser_path, recursive_depth + 1);
FindParserSo(full_name, file_list, caffe_parser_path);
}
closedir(dir);
return;


+ 1
- 2
inc/framework/omg/omg.h View File

@@ -91,8 +91,7 @@ GE_FUNC_VISIBILITY Status ConvertFwkModelToJson(domi::FrameworkType framework, c

GE_FUNC_VISIBILITY void GetGroupName(ge::proto::ModelDef &model);

GE_FUNC_VISIBILITY void FindParserSo(const string &path, vector<string> &fileList, string &caffe_parser_path,
uint32_t recursive_depth = 0);
GE_FUNC_VISIBILITY void FindParserSo(const string &path, vector<string> &fileList, string &caffe_parser_path);

GE_FUNC_VISIBILITY Status DumpInfershapeJson(const ge::Graph &graph, const char *json_file);



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

@@ -48,13 +48,4 @@ TEST_F(UtestOmg, display_model_info_success) {
attr_def->mutable_list()->add_i(4);
PrintModelInfo(&model_def, 1);
}
TEST_F(UtestOmg, find_parser_so) {
string path = "";
vector<string> file_list = {};
string caffe_parser_path = "";
FindParserSo(path, file_list, caffe_parser_path);
path = "/lib64";
FindParserSo(path, file_list, caffe_parser_path);
}
} // namespace ge

Loading…
Cancel
Save