!26593 clean code for 1.5

Merge pull request !26593 from changzherui/clean_code_1.5_3
This commit is contained in:
i-robot 2021-11-23 15:22:37 +00:00 committed by Gitee
commit 30ae0accfb
3 changed files with 3 additions and 7 deletions

View File

@ -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<Int>()) {
attr_proto->set_type(mind_ir::AttributeProto_AttributeType_TENSORS);
mind_ir::TensorProto *tensor_proto = attr_proto->add_tensors();

View File

@ -863,11 +863,10 @@ DfGraphConvertor &DfGraphConvertor::BuildGraph() {
UpdateOpDesc(it);
}
if (error_ == 0) {
df_graph_ = make_shared<DfGraph>(anf_graph_->ToString());
} else {
if (error_ != 0) {
return *this;
}
df_graph_ = make_shared<DfGraph>(anf_graph_->ToString());
// set graph input according to the order from anf graph
std::vector<Operator> inputs;

View File

@ -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)