| 61 | } |
| 62 | |
| 63 | TEST(API, copy_to) { |
| 64 | // 1. create tensor |
| 65 | auto x = CreateInputTensor(); |
| 66 | |
| 67 | // 2. test API |
| 68 | #if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) |
| 69 | auto tmp = paddle::experimental::copy_to(x, phi::GPUPlace(), false); |
| 70 | auto out = paddle::experimental::copy_to(tmp, phi::CPUPlace(), true); |
| 71 | #else |
| 72 | auto out = paddle::experimental::copy_to(x, phi::CPUPlace(), false); |
| 73 | #endif |
| 74 | |
| 75 | // 3. check result |
| 76 | CheckOutputResult(out); |
| 77 | } |
| 78 | |
| 79 | TEST(Tensor, copy_to) { |
| 80 | // 1. create tensor |
nothing calls this directly
no test coverage detected