diff --git a/mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_generate_strategy.cc b/mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_generate_strategy.cc old mode 100644 new mode 100755 index a7b613402be..364405a179e --- a/mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_generate_strategy.cc +++ b/mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_generate_strategy.cc @@ -73,8 +73,9 @@ Strategys PrepareMatMul(const std::shared_ptr &graph, const std::vectorDeviceNum(); - if (graph->nodes[iter_graph].apply.arguments[0].tensor_str.str_h != max_cut && - graph->nodes[iter_graph].apply.arguments[1].tensor_str.str_w != max_cut) { + // The rule of cut is 0.5, 0.125. To compare the result we have to use ">" so we multiply max_cut to 1.1 + if (graph->nodes[iter_graph].apply.arguments[0].tensor_str.str_h > max_cut * 1.1 && + graph->nodes[iter_graph].apply.arguments[1].tensor_str.str_w > max_cut * 1.1) { graph->nodes[iter_graph].apply.arguments[0].tensor_str.str_h = 1.0; graph->nodes[iter_graph].apply.arguments[0].tensor_str.str_w = 1.0; graph->nodes[iter_graph].apply.arguments[1].tensor_str.str_h = 1.0;