diff --git a/mindspore/ccsrc/debug/anf_ir_dump.cc b/mindspore/ccsrc/debug/anf_ir_dump.cc index 621223eea52..502af18e916 100644 --- a/mindspore/ccsrc/debug/anf_ir_dump.cc +++ b/mindspore/ccsrc/debug/anf_ir_dump.cc @@ -68,7 +68,7 @@ void PrintNodeOutputType(std::ostringstream &buffer, const AnfNodePtr &nd) { abstract::ShapePtr shape = dyn_cast(nd->Shape()); TypePtr type = dyn_cast(nd->Type()); if ((shape != nullptr) && (type != nullptr)) { - buffer << "<" << type << "x" << shape->shape() << ">"; + buffer << "<" << type << "x" << shape->ToString() << ">"; } else if (type != nullptr) { buffer << "<" << type << ">"; } else { diff --git a/mindspore/ccsrc/pipeline/jit/pipeline.cc b/mindspore/ccsrc/pipeline/jit/pipeline.cc index a490f29e2b8..2c11c24805e 100644 --- a/mindspore/ccsrc/pipeline/jit/pipeline.cc +++ b/mindspore/ccsrc/pipeline/jit/pipeline.cc @@ -1226,7 +1226,15 @@ void ExportGraph(const std::string &file_name, const std::string &, const std::s FuncGraphPtr LoadMindIR(const std::string &file_name, char *dec_key, const size_t key_len, const std::string &dec_mode) { - return mindspore::LoadMindIR(file_name, false, reinterpret_cast(dec_key), key_len, dec_mode); + auto func_graph = + mindspore::LoadMindIR(file_name, false, reinterpret_cast(dec_key), key_len, dec_mode); + auto context_ptr = MsContext::GetInstance(); + MS_EXCEPTION_IF_NULL(context_ptr); + bool save_graphs = context_ptr->get_param(MS_CTX_SAVE_GRAPHS_FLAG); + if (save_graphs) { + DumpIR("load.ir", func_graph); + } + return func_graph; } void ReleaseGeTsd() { diff --git a/mindspore/core/abstract/dshape.cc b/mindspore/core/abstract/dshape.cc index 26aa401c7af..60e327e8c9c 100644 --- a/mindspore/core/abstract/dshape.cc +++ b/mindspore/core/abstract/dshape.cc @@ -67,15 +67,15 @@ std::string Shape::ToString() const { std::ostringstream buffer; bool has_dyn_shape = IsDynamic(); if (has_dyn_shape) { - buffer << "{ shape : "; + buffer << "{shape:"; } buffer << ShapeVectorToStr(shape_); if (has_dyn_shape) { - buffer << " | min shape: "; + buffer << "|min shape:"; buffer << ShapeVectorToStr(min_shape_); - buffer << " | max shape: "; + buffer << "|max shape:"; buffer << ShapeVectorToStr(max_shape_); - buffer << " }"; + buffer << "}"; } return buffer.str(); } diff --git a/tests/ut/cpp/abstract/dshape_test.cc b/tests/ut/cpp/abstract/dshape_test.cc index a6f92b9cecb..55623818f40 100644 --- a/tests/ut/cpp/abstract/dshape_test.cc +++ b/tests/ut/cpp/abstract/dshape_test.cc @@ -69,7 +69,7 @@ TEST_F(TestDShape, ToString) { ASSERT_EQ(shp_3.ToString(), "(1, 2)"); ASSERT_EQ(shp_noshp_1.ToString(), "NoShape"); ASSERT_EQ(shp_tuple_2.ToString(), "TupleShape(NoShape, (1, 1, 1))"); - ASSERT_EQ(shp_5.ToString(), "{ shape : (-1, 2) | min shape: (1, 2) | max shape: (3, 3) }"); + ASSERT_EQ(shp_5.ToString(), "{shape:(-1, 2)|min shape:(1, 2)|max shape:(3, 3)}"); } TEST_F(TestDShape, Clone) {