   in1_value->mutable_data<float>(
       paddle::framework::make_ddim(
           {static_cast<int64_t>(rows1.size()), row_numel}),
-      cpu_place);
+      gpu_place);
   set_const(ctx, in1_value, 1.0);
 
   std::vector<int64_t> rows2{2, 5, 3, 5, 3};

  merge_add_functor(ctx, inputs, output.get());

  paddle::framework::Tensor output_cpu;
  paddle::framework::TensorCopy(*output, cpu_place, ctx, &output_cpu);
  ctx.Wait();

  EXPECT_EQ(output->height(), height);

  in2_value->mutable_data<float>(
      paddle::framework::make_ddim(
          {static_cast<int64_t>(rows2.size()), row_numel}),
      gpu_place);
  set_const(ctx, in2_value, 1.0);

  std::unique_ptr<paddle::framework::SelectedRows> output{
