From 193a0d1403a999ba4eb55a17c77c25d843cbe126 Mon Sep 17 00:00:00 2001 From: changzherui Date: Sun, 21 Nov 2021 20:42:51 +0800 Subject: [PATCH] clean code for 1.5 --- mindspore/ccsrc/transform/express_ir/mindir_exporter.cc | 3 --- mindspore/ccsrc/transform/graph_ir/convert.cc | 5 ++--- mindspore/context.py | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mindspore/ccsrc/transform/express_ir/mindir_exporter.cc b/mindspore/ccsrc/transform/express_ir/mindir_exporter.cc index 8485f8b0a18..925c5cb15b0 100644 --- a/mindspore/ccsrc/transform/express_ir/mindir_exporter.cc +++ b/mindspore/ccsrc/transform/express_ir/mindir_exporter.cc @@ -720,9 +720,6 @@ void IrExportBuilder::SetScalarToAttributeProto_ir(const ValuePtr &value, mind_i } void IrExportBuilder::SetScalarToAttributeProto_irs(const ValuePtr &value, mind_ir::AttributeProto *const attr_proto) { - if (value == nullptr || attr_proto == nullptr) { - MS_LOG(EXCEPTION) << "ValuePtr or AttributeProto is null!"; - } if (value->isa()) { attr_proto->set_type(mind_ir::AttributeProto_AttributeType_TENSORS); mind_ir::TensorProto *tensor_proto = attr_proto->add_tensors(); diff --git a/mindspore/ccsrc/transform/graph_ir/convert.cc b/mindspore/ccsrc/transform/graph_ir/convert.cc index e9b8e789a1d..5aa9fdbc206 100644 --- a/mindspore/ccsrc/transform/graph_ir/convert.cc +++ b/mindspore/ccsrc/transform/graph_ir/convert.cc @@ -863,11 +863,10 @@ DfGraphConvertor &DfGraphConvertor::BuildGraph() { UpdateOpDesc(it); } - if (error_ == 0) { - df_graph_ = make_shared(anf_graph_->ToString()); - } else { + if (error_ != 0) { return *this; } + df_graph_ = make_shared(anf_graph_->ToString()); // set graph input according to the order from anf graph std::vector inputs; diff --git a/mindspore/context.py b/mindspore/context.py index 5a29a94cbb1..e13d79495d4 100644 --- a/mindspore/context.py +++ b/mindspore/context.py @@ -736,7 +736,7 @@ def set_context(**kwargs): >>> context.set_context(precompile_only=True) >>> context.set_context(device_target="Ascend") >>> context.set_context(device_id=0) - >>> context.set_context(save_graphs=True, save_graphs_path="./model.ms") + >>> context.set_context(save_graphs=True, save_graphs_path="./graph") >>> context.set_context(enable_reduce_precision=True) >>> context.set_context(enable_dump=True, save_dump_path=".") >>> context.set_context(enable_graph_kernel=True)