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

Function CheckOutputResult

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

Source from the content-addressed store, hash-verified

47}
48
49void CheckOutputResult(const paddle::Tensor& out) {
50 ASSERT_EQ(out.dims().size(), 2);
51 ASSERT_EQ(out.dims()[0], 3);
52 ASSERT_EQ(out.dims()[1], 4);
53 ASSERT_EQ(out.is_cpu(), true);
54 ASSERT_EQ(out.type(), phi::DataType::INT64);
55 ASSERT_EQ(out.layout(), phi::DataLayout::NCHW);
56 ASSERT_EQ(out.initialized(), true);
57
58 for (int64_t i = 0; i < 12; ++i) {
59 ASSERT_EQ(out.data<int64_t>()[i], i);
60 }
61}
62
63TEST(API, copy_to) {
64 // 1. create tensor

Callers 1

TESTFunction · 0.85

Calls 6

sizeMethod · 0.45
dimsMethod · 0.45
is_cpuMethod · 0.45
typeMethod · 0.45
layoutMethod · 0.45
initializedMethod · 0.45

Tested by

no test coverage detected