!10600 modify load mindir

From: @changzherui
Reviewed-by: @zhunaipan,@zh_qh
Signed-off-by: @zh_qh
This commit is contained in:
mindspore-ci-bot 2020-12-27 16:34:13 +08:00 committed by Gitee
commit 1ec501f2e8
1 changed files with 8 additions and 0 deletions

View File

@ -102,6 +102,10 @@ std::shared_ptr<T> ParserAttr(const std::string &str, const std::unordered_map<s
count++;
if (str[i + 1] == '[' || str[i + 1] == ']' || str[i + 1] == ',') {
auto value_name = str.substr(i - count + 1, count);
if (kv.find(value_name) == kv.end()) {
MS_LOG(ERROR) << "Node's attributes and shape do not match.";
return nullptr;
}
value.push(kv.at(value_name));
rules.push(value_name);
count = 0;
@ -723,6 +727,10 @@ CNodePtr MSANFModelParser::BuildCNodeForFuncGraph(const FuncGraphPtr &outputFunc
cnode_ptr->set_abstract(iter->second);
} else {
auto abstract = ParserAttrShape(shape_ref_attr_name, kv);
if (abstract == nullptr) {
MS_LOG(ERROR) << "Node's attribute is nullptr.";
return nullptr;
}
cnode_ptr->set_abstract(abstract);
}