Browse Source

modify export air and check file_name

tags/v1.1.0
changzherui 5 years ago
parent
commit
e4b730260a
2 changed files with 6 additions and 3 deletions
  1. +2
    -1
      mindspore/_checkparam.py
  2. +4
    -2
      mindspore/ccsrc/transform/graph_ir/convert.cc

+ 2
- 1
mindspore/_checkparam.py 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(


+ 4
- 2
mindspore/ccsrc/transform/graph_ir/convert.cc 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;
}



Loading…
Cancel
Save