diff --git a/paddle/fluid/operators/tensorrt/tensorrt_engine_op.h b/paddle/fluid/operators/tensorrt/tensorrt_engine_op.h index 5ad7980b8afebab09388de38416bd917f833c5dc..18ed1d9eaa9eb5f450331471cddb2c0fef589477 100644 --- a/paddle/fluid/operators/tensorrt/tensorrt_engine_op.h +++ b/paddle/fluid/operators/tensorrt/tensorrt_engine_op.h @@ -501,8 +501,7 @@ class TensorRTEngineOp : public framework::OperatorBase { // check the input_tensor if (!platform::is_gpu_place(t.place())) { phi::DenseTensor out; - platform::CUDAPlace dst_place; - framework::TransDataDevice(t, dst_place, &out); + framework::TensorCopy(t, dev_place, dev_ctx, &out); t.ShareDataWith(out); } auto t_shape = phi::vectorize(t.dims());