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

Function TEST_P

tensorflow/compiler/xla/tests/pad_test.cc:141–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141TEST_P(PadTestFloat, Pad4DFloat_1x1x3x2_Array) {
142 XlaBuilder b(TestName());
143 auto input = absl::make_unique<Array4D<float>>(1, 1, 3, 2);
144 Array2D<float> input_xy({
145 {1.0f, 2.0f}, // row 0
146 {3.0f, 4.0f}, // row 1
147 {5.0f, 6.0f}, // row 2
148 });
149 input->FillWithYX(input_xy);
150
151 Pad(AddParam(*input, &b), AddParam(LiteralUtil::CreateR0<float>(1.5), &b),
152 r4_padding_on_dim0_dim1_);
153
154 auto expected = absl::make_unique<Array4D<float>>(2, 3, 3, 2);
155 expected->Fill(1.5);
156 (*expected)(1, 0, 0, 0) = 1.0f;
157 (*expected)(1, 0, 0, 1) = 2.0f;
158 (*expected)(1, 0, 1, 0) = 3.0f;
159 (*expected)(1, 0, 1, 1) = 4.0f;
160 (*expected)(1, 0, 2, 0) = 5.0f;
161 (*expected)(1, 0, 2, 1) = 6.0f;
162 ComputeAndCompareR4<float>(&b, *expected, {}, DefaultErrorSpec());
163}
164
165TEST_P(PadTestFloat, Pad4DFloatArrayWithInteriorPadding) {
166 XlaBuilder b(TestName());

Callers

nothing calls this directly

Calls 8

TestNameFunction · 0.85
FillWithYXMethod · 0.80
add_dimensionsMethod · 0.80
RelayoutMethod · 0.80
ErrorSpecClass · 0.70
PadFunction · 0.50
MakeLayoutFunction · 0.50
FillMethod · 0.45

Tested by

no test coverage detected