Skip to content

Commit e309f42

Browse files
committed
fix errors in concat_test
1 parent 0285a2b commit e309f42

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

paddle/fluid/operators/math/concat_test.cc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ void testConcat() {
6969
}
7070

7171
if (paddle::platform::is_gpu_place(Place())) {
72-
paddle::framework::TensorCopy(input_a_cpu, Place(), *context, &input_a);
73-
paddle::framework::TensorCopy(input_b_cpu, Place(), *context, &input_b);
72+
paddle::framework::TensorCopySync(input_a_cpu, Place(), &input_a);
73+
paddle::framework::TensorCopySync(input_b_cpu, Place(), &input_b);
7474
}
7575

7676
std::vector<paddle::framework::Tensor> input;
@@ -86,8 +86,8 @@ void testConcat() {
8686

8787
int* out_ptr;
8888
if (paddle::platform::is_gpu_place(Place())) {
89-
paddle::framework::TensorCopy(out, paddle::platform::CPUPlace(), *context,
90-
&out_cpu);
89+
paddle::framework::TensorCopySync(out, paddle::platform::CPUPlace(),
90+
&out_cpu);
9191
out_ptr = out_cpu.data<int>();
9292
} else {
9393
out_ptr = out.data<int>();
@@ -142,8 +142,8 @@ void testConcat() {
142142
}
143143

144144
if (paddle::platform::is_gpu_place(Place())) {
145-
paddle::framework::TensorCopy(input_a_cpu, Place(), *context, &input_a);
146-
paddle::framework::TensorCopy(input_b_cpu, Place(), *context, &input_b);
145+
paddle::framework::TensorCopySync(input_a_cpu, Place(), &input_a);
146+
paddle::framework::TensorCopySync(input_b_cpu, Place(), &input_b);
147147
}
148148

149149
input.clear();
@@ -157,8 +157,8 @@ void testConcat() {
157157
PADDLE_ENFORCE_EQ(input_b.dims(), dim_b);
158158

159159
if (paddle::platform::is_gpu_place(Place())) {
160-
paddle::framework::TensorCopy(out, paddle::platform::CPUPlace(), *context,
161-
&out_cpu);
160+
paddle::framework::TensorCopySync(out, paddle::platform::CPUPlace(),
161+
&out_cpu);
162162
out_ptr = out_cpu.data<int>();
163163
} else {
164164
out_ptr = out.data<int>();
@@ -215,8 +215,8 @@ void testConcat() {
215215
}
216216

217217
if (paddle::platform::is_gpu_place(Place())) {
218-
paddle::framework::TensorCopy(input_a_cpu, Place(), *context, &input_a);
219-
paddle::framework::TensorCopy(input_b_cpu, Place(), *context, &input_b);
218+
paddle::framework::TensorCopySync(input_a_cpu, Place(), &input_a);
219+
paddle::framework::TensorCopySync(input_b_cpu, Place(), &input_b);
220220
}
221221

222222
input.clear();
@@ -230,8 +230,8 @@ void testConcat() {
230230
PADDLE_ENFORCE_EQ(input_b.dims(), dim_b);
231231

232232
if (paddle::platform::is_gpu_place(Place())) {
233-
paddle::framework::TensorCopy(out, paddle::platform::CPUPlace(), *context,
234-
&out_cpu);
233+
paddle::framework::TensorCopySync(out, paddle::platform::CPUPlace(),
234+
&out_cpu);
235235
out_ptr = out_cpu.data<int>();
236236
} else {
237237
out_ptr = out.data<int>();
@@ -290,8 +290,8 @@ void testConcat() {
290290
}
291291

292292
if (paddle::platform::is_gpu_place(Place())) {
293-
paddle::framework::TensorCopy(input_a_cpu, Place(), *context, &input_a);
294-
paddle::framework::TensorCopy(input_b_cpu, Place(), *context, &input_b);
293+
paddle::framework::TensorCopySync(input_a_cpu, Place(), &input_a);
294+
paddle::framework::TensorCopySync(input_b_cpu, Place(), &input_b);
295295
}
296296

297297
input.clear();
@@ -305,8 +305,8 @@ void testConcat() {
305305
PADDLE_ENFORCE_EQ(input_b.dims(), dim_b);
306306

307307
if (paddle::platform::is_gpu_place(Place())) {
308-
paddle::framework::TensorCopy(out, paddle::platform::CPUPlace(), *context,
309-
&out_cpu);
308+
paddle::framework::TensorCopySync(out, paddle::platform::CPUPlace(),
309+
&out_cpu);
310310
out_ptr = out_cpu.data<int>();
311311
} else {
312312
out_ptr = out.data<int>();

0 commit comments

Comments
 (0)