MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST_P

Function TEST_P

tensorflow/lite/kernels/expand_dims_test.cc:71–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69class ExpandDimsOpTest : public ::testing::TestWithParam<TestType> {};
70
71TEST_P(ExpandDimsOpTest, PositiveAxis) {
72 std::initializer_list<float> values = {-1.f, 1.f, -2.f, 2.f};
73
74 ExpandDimsOpModel<float> axis_0(0, {2, 2}, values, GetParam());
75 axis_0.Invoke();
76 EXPECT_THAT(axis_0.GetValues(), ElementsAreArray(values));
77 EXPECT_THAT(axis_0.GetOutputShape(), ElementsAreArray({1, 2, 2}));
78
79 ExpandDimsOpModel<float> axis_1(1, {2, 2}, values, GetParam());
80 axis_1.Invoke();
81 EXPECT_THAT(axis_1.GetValues(), ElementsAreArray(values));
82 EXPECT_THAT(axis_1.GetOutputShape(), ElementsAreArray({2, 1, 2}));
83
84 ExpandDimsOpModel<float> axis_2(2, {2, 2}, values, GetParam());
85 axis_2.Invoke();
86 EXPECT_THAT(axis_2.GetValues(), ElementsAreArray(values));
87 EXPECT_THAT(axis_2.GetOutputShape(), ElementsAreArray({2, 2, 1}));
88}
89
90TEST_P(ExpandDimsOpTest, NegativeAxis) {
91 std::initializer_list<float> values = {-1.f, 1.f, -2.f, 2.f};

Callers

nothing calls this directly

Calls 4

GetParamFunction · 0.85
InvokeMethod · 0.45
GetValuesMethod · 0.45
GetOutputShapeMethod · 0.45

Tested by

no test coverage detected