Browse Source

Pre Merge pull request !534 from 王磊/ge_dev_tmp

pull/534/MERGE
王磊 Gitee 4 years ago
parent
commit
8300ee5212
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 7 additions and 8 deletions
  1. +1
    -1
      parser/caffe/caffe_parser.h
  2. +4
    -4
      parser/common/acl_graph_parser_util.cc
  3. +2
    -3
      parser/common/model_saver.cc

+ 1
- 1
parser/caffe/caffe_parser.h View File

@@ -57,7 +57,7 @@ static std::map<std::vector<std::string>, std::vector<std::string>> params_share
class PARSER_FUNC_VISIBILITY CaffeModelParser : public domi::ModelParser {
public:
CaffeModelParser() {}
virtual ~CaffeModelParser() override {}
~CaffeModelParser() override {}

/**
* @ingroup domi_omg


+ 4
- 4
parser/common/acl_graph_parser_util.cc View File

@@ -309,10 +309,10 @@ domi::Status AclGrphParseUtil::ParseAclOutputNodes(const string &out_nodes) {
return PARAM_INVALID;
}

auto iter = ge::GetParserContext().out_nodes_map.find(key_value_v[0]);
const auto iter = ge::GetParserContext().out_nodes_map.find(key_value_v[0]);
int32_t index = stoi(StringUtils::Trim(key_value_v[1]));
GELOGD("Get output info: node[%s] and index[%d]", key_value_v[0].c_str(), index);
if (iter != ge::GetParserContext().out_nodes_map.end()) {
if (iter != ge::GetParserContext().out_nodes_map.cend()) {
iter->second.emplace_back(index);
} else {
std::vector<int32_t> index_v;
@@ -943,7 +943,7 @@ FMK_FUNC_HOST_VISIBILITY bool ValidateStr(const std::string &filePath, const std
regex_t reg;
int cflags = REG_EXTENDED | REG_NOSUB;
int ret = regcomp(&reg, mode.c_str(), cflags);
if (ret) {
if (ret != 0) {
regerror(ret, &reg, ebuff, kMaxBuffSize);
GELOGW("regcomp failed, reason: %s", ebuff);
regfree(&reg);
@@ -951,7 +951,7 @@ FMK_FUNC_HOST_VISIBILITY bool ValidateStr(const std::string &filePath, const std
}

ret = regexec(&reg, filePath.c_str(), 0, nullptr, 0);
if (ret) {
if (ret != 0) {
regerror(ret, &reg, ebuff, kMaxBuffSize);
GELOGE(ge::PARAM_INVALID, "[Invoke][RegExec] failed, reason: %s", ebuff);
regfree(&reg);


+ 2
- 3
parser/common/model_saver.cc View File

@@ -74,10 +74,9 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelSaver::SaveJsonToFi
GELOGE(FAILED, "[Open][File] [%s] failed. %s", file_path, err_msg);
return FAILED;
}
const char *model_char = model_str.c_str();
uint32_t len = static_cast<uint32_t>(model_str.length());
// Write data to file
mmSsize_t mmpa_ret = mmWrite(fd, const_cast<void *>((const void *)model_char), len);
mmSsize_t mmpa_ret = mmWrite(fd, const_cast<void *>(static_cast<const void *>(model_str.c_str())), len);
if (mmpa_ret == EN_ERROR || mmpa_ret == EN_INVALID_PARAM) {
char_t err_buf[kMaxErrStrLen + 1U] = {};
const auto err_msg = mmGetErrorFormatMessage(mmGetErrorCode(), &err_buf[0], kMaxErrStrLen);
@@ -176,4 +175,4 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY int ModelSaver::CreateDirectory
}

} // namespace parser
} // namespace ge
} // namespace ge

Loading…
Cancel
Save