diff --git a/paddle/phi/kernels/onednn/split_kernel.cc b/paddle/phi/kernels/onednn/split_kernel.cc index 94c0924e36e00bf60c5e0fbc4287c2321b458b80..057aa7325f165c3251c395dcbb6dcecc4f96b8c8 100644 --- a/paddle/phi/kernels/onednn/split_kernel.cc +++ b/paddle/phi/kernels/onednn/split_kernel.cc @@ -69,10 +69,8 @@ void SplitWithNumKernel(const Context& dev_ctx, std::vector outs) { int axis_value = axis_scalar.to(); auto input_axis_dim = x.dims().at(axis_value); - std::vector sections_vec; - for (int i = 0; i < num; ++i) { - sections_vec.push_back(input_axis_dim / num); - } + const std::vector sections_vec(num, input_axis_dim / num); + IntArray sections(sections_vec); SplitKernel(dev_ctx, x, sections, axis_scalar, outs); }