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

Function TEST

test/cpp/phi/common/test_data_layout.cc:26–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace tests {
25
26TEST(DataLayout, OStream) {
27 std::ostringstream oss;
28 oss << phi::DataLayout::UNDEFINED;
29 EXPECT_EQ(oss.str(), "Undefined(AnyLayout)");
30 oss.str("");
31 oss << phi::DataLayout::ANY;
32 EXPECT_EQ(oss.str(), "Undefined(AnyLayout)");
33 oss.str("");
34 oss << phi::DataLayout::NHWC;
35 EXPECT_EQ(oss.str(), "NHWC");
36 oss.str("");
37 oss << phi::DataLayout::NCHW;
38 EXPECT_EQ(oss.str(), "NCHW");
39 oss.str("");
40 oss << phi::DataLayout::ONEDNN;
41 EXPECT_EQ(oss.str(), "ONEDNN");
42 oss.str("");
43 try {
44 oss << phi::DataLayout::NUM_DATA_LAYOUTS;
45 } catch (const std::exception& exception) {
46 std::string ex_msg = exception.what();
47 EXPECT_TRUE(ex_msg.find("Unknown Data Layout type") != std::string::npos);
48 }
49}
50
51} // namespace tests
52} // namespace phi

Callers

nothing calls this directly

Calls 3

strMethod · 0.45
whatMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected