diff --git a/mindspore/ccsrc/frontend/parallel/ops_info/reshape_info.cc b/mindspore/ccsrc/frontend/parallel/ops_info/reshape_info.cc index b27e33f284..668b817b8d 100644 --- a/mindspore/ccsrc/frontend/parallel/ops_info/reshape_info.cc +++ b/mindspore/ccsrc/frontend/parallel/ops_info/reshape_info.cc @@ -423,6 +423,7 @@ void ReshapeInfo::SetCostForReshape(const mindspore::parallel::StrategyPtr &stra std::make_shared(strategy, inputs_tensor_info_, outputs_tensor_info_); swc->cost_list.push_back(result); strategy_cost_.emplace_back(swc); + ResetQueueMember(); } Status ReshapeInfo::GenerateStrategies(int32_t stage_id) { diff --git a/mindspore/ccsrc/frontend/parallel/tensor_layout/tensor_redistribution.cc b/mindspore/ccsrc/frontend/parallel/tensor_layout/tensor_redistribution.cc index 4e45775123..f7ef356303 100644 --- a/mindspore/ccsrc/frontend/parallel/tensor_layout/tensor_redistribution.cc +++ b/mindspore/ccsrc/frontend/parallel/tensor_layout/tensor_redistribution.cc @@ -223,7 +223,8 @@ Status TensorRedistribution::ComputeCost() { } else { prev_shape = from_.tensor_shape().array(); } - double prev_prod = std::accumulate(prev_shape.begin(), prev_shape.end(), 1, std::multiplies()); + double prev_prod = + std::accumulate(prev_shape.begin(), prev_shape.end(), static_cast(1.0), std::multiplies()); computation_cost_ += 2.0 * prev_prod; memory_cost_ += 2.0 * prev_prod; }