forked from mindspore-Ecosystem/mindspore
!9838 modify export air and check file_name
From: @changzherui Reviewed-by: @kingxian,@zhunaipan Signed-off-by: @kingxian
This commit is contained in:
commit
c70735c19f
|
@ -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(
|
||||
|
|
|
@ -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…
Reference in New Issue