diff --git a/paddle/fluid/operators/reshape_op.cc b/paddle/fluid/operators/reshape_op.cc index 1a0a8581184909e976c66cf6fc021f79576982c7..7b93ea15de3da3c0b5d6f0a93b1e96dbbc75fd2f 100644 --- a/paddle/fluid/operators/reshape_op.cc +++ b/paddle/fluid/operators/reshape_op.cc @@ -405,7 +405,9 @@ class ReshapeGradKernel { auto in_dims = d_x->dims(); d_x->mutable_data(ctx.GetPlace(), d_out->type()); - framework::TensorCopySync(*d_out, ctx.GetPlace(), d_x); + framework::TensorCopy( + *d_out, ctx.GetPlace(), + ctx.template device_context(), d_x); d_x->Resize(in_dims); } }; @@ -419,7 +421,9 @@ class ReshapeDoubleGradKernel { auto out_dims = dd_out->dims(); dd_out->mutable_data(ctx.GetPlace(), dd_x->type()); - framework::TensorCopySync(*dd_x, ctx.GetPlace(), dd_out); + framework::TensorCopy( + *dd_x, ctx.GetPlace(), + ctx.template device_context(), dd_out); dd_out->Resize(out_dims); } };