diff --git a/mindspore/ccsrc/plugin/device/gpu/kernel/sparse/sparse_matrix_softmax_gpu_kernel.cc b/mindspore/ccsrc/plugin/device/gpu/kernel/sparse/sparse_matrix_softmax_gpu_kernel.cc index 8e988f36870..aa7141b753c 100644 --- a/mindspore/ccsrc/plugin/device/gpu/kernel/sparse/sparse_matrix_softmax_gpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/gpu/kernel/sparse/sparse_matrix_softmax_gpu_kernel.cc @@ -68,7 +68,7 @@ int SparseMatrixSoftmaxGpuKernelMod::Resize(const BaseOperatorPtr &base_operator input_row_pointers_ = std::vector(inputs.at(kIndex2)->GetDeviceShapeAdaptively().begin(), inputs.at(kIndex2)->GetDeviceShapeAdaptively().end()); row_pointers_elements_ = - std::accumulate(input_row_pointers_.begin(), input_row_pointers_.end(), 1, std::multiplies()); + std::accumulate(input_row_pointers_.begin(), input_row_pointers_.end(), 1, std::multiplies()) - 1; input_col_indices_ = std::vector(inputs.at(kIndex3)->GetDeviceShapeAdaptively().begin(), inputs.at(kIndex3)->GetDeviceShapeAdaptively().end());