MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / TEST

Function TEST

test/cpp/phi/api/test_to_api.cc:63–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63TEST(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
79TEST(Tensor, copy_to) {
80 // 1. create tensor

Callers

nothing calls this directly

Calls 5

CreateInputTensorFunction · 0.85
GPUPlaceClass · 0.85
CheckOutputResultFunction · 0.85
copy_toMethod · 0.80
CPUPlaceClass · 0.50

Tested by

no test coverage detected