From e94e522cb4682f7f80ce3aa1264703cdc448e9e1 Mon Sep 17 00:00:00 2001 From: wanghuancoder Date: Mon, 18 Sep 2023 10:52:23 +0800 Subject: [PATCH] fix concat bug, init inputs_data_vec (#57389) --- paddle/phi/kernels/funcs/concat_and_split_functor.cu | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/phi/kernels/funcs/concat_and_split_functor.cu b/paddle/phi/kernels/funcs/concat_and_split_functor.cu index 975b1361423abd..f2b7de681bcfce 100644 --- a/paddle/phi/kernels/funcs/concat_and_split_functor.cu +++ b/paddle/phi/kernels/funcs/concat_and_split_functor.cu @@ -571,6 +571,9 @@ void ConcatFunctorWithIndexType(const phi::GPUContext& ctx, IndexT inputs_col_num = in_num + 1; std::vector inputs_data_vec(in_num, nullptr); + for (size_t i = 0; i < ins.size(); ++i) { + inputs_data_vec[i] = ins[i].data(); + } std::vector inputs_col_vec(inputs_col_num, 0); const T** inputs_data = inputs_data_vec.data(); IndexT* inputs_col = inputs_col_vec.data();