| 139 | } |
| 140 | |
| 141 | TEST_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 | |
| 165 | TEST_P(PadTestFloat, Pad4DFloatArrayWithInteriorPadding) { |
| 166 | XlaBuilder b(TestName()); |
nothing calls this directly
no test coverage detected