| 74 | |
| 75 | template <typename Context> |
| 76 | void MemcpyD2HMultiIOKernel(const Context& dev_ctx, |
| 77 | const TensorArray& array, |
| 78 | int dst_place_type, |
| 79 | TensorArray* out_array) { |
| 80 | PADDLE_ENFORCE_NOT_NULL( |
| 81 | out_array, |
| 82 | errors::PreconditionNotMet("output tensor_array should not be nullptr")); |
| 83 | |
| 84 | out_array->clear(); |
| 85 | out_array->resize(array.size()); |
| 86 | for (size_t i = 0; i < array.size(); i++) { |
| 87 | const auto& x = array[i]; |
| 88 | MemcpyD2HKernel<Context>(dev_ctx, x, dst_place_type, &(out_array->at(i))); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | template <typename Context> |
| 93 | void MemcpyKernel(const Context& dev_ctx, |