!9838 modify export air and check file_name

From: @changzherui
Reviewed-by: @kingxian,@zhunaipan
Signed-off-by: @kingxian
This commit is contained in:
mindspore-ci-bot 2020-12-12 09:25:30 +08:00 committed by Gitee
commit c70735c19f
2 changed files with 6 additions and 3 deletions

View File

@ -429,8 +429,9 @@ class Validator:
@staticmethod
def check_file_name_by_regular(target, reg=None, flag=re.ASCII, prim_name=None):
"""Check whether file name is legitimate."""
if reg is None:
reg = r"^[0-9a-zA-Z\_\-\.\/\\]*$"
reg = r"^[0-9a-zA-Z\_\-\.\/\\]+$"
if re.match(reg, target, flag) is None:
prim_name = f'in `{prim_name}`' if prim_name else ""
raise ValueError("'{}' {} is illegal, it should be match regular'{}' by flags'{}'".format(

View File

@ -596,8 +596,10 @@ void DfGraphConvertor::TraceOutput(const AnfNodePtr node) {
// Trace value node
if (node->isa<ValueNode>()) {
auto op = Convert(anf_out);
graph_outputs_.emplace_back(std::make_pair(*op, ""));
AddGraphConstInput(op);
if (op != nullptr) {
graph_outputs_.emplace_back(std::make_pair(*op, ""));
AddGraphConstInput(op);
}
return;
}