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

Function XLA_TEST_F

tensorflow/compiler/xla/tests/convolution_test.cc:243–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241TYPED_TEST(Convolve_1x1x4x4_1x1x3x3_Same, Types) { this->RunTest(); }
242
243XLA_TEST_F(ConvolutionTest, Convolve1D_1x2x5_1x2x2_Valid) {
244 XlaBuilder builder(TestName());
245 {
246 Shape input_shape = ShapeUtil::MakeShape(F32, {1, 2, 5});
247 Shape filter_shape = ShapeUtil::MakeShape(F32, {1, 2, 2});
248 auto input = Parameter(&builder, 0, input_shape, "input");
249 auto filter = Parameter(&builder, 1, filter_shape, "filter");
250 Conv(input, filter, {1}, Padding::kValid);
251 }
252
253 Array3D<float> input({{{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}}});
254 Array3D<float> filter({{{10, 20}, {30, 40}}});
255
256 Array3D<float> expected({{{510, 610, 710, 810}}});
257
258 auto input_literal =
259 client_->TransferToServer(LiteralUtil::CreateR3FromArray3D(input))
260 .ConsumeValueOrDie();
261 auto filter_literal =
262 client_->TransferToServer(LiteralUtil::CreateR3FromArray3D(filter))
263 .ConsumeValueOrDie();
264
265 ComputeAndCompareR3<float>(&builder, expected,
266 {input_literal.get(), filter_literal.get()},
267 error_spec_);
268}
269
270template <typename T>
271class Convolve1D_1x2x5_1x2x2_WithRHSDilation : public ConvolutionTest {

Callers

nothing calls this directly

Calls 15

TestNameFunction · 0.85
MakeShapeFunction · 0.85
ConvGeneralDilatedFunction · 0.85
ConstantR4FromArray4DFunction · 0.85
ConvGeneralFunction · 0.85
RunAndCompareFunction · 0.85
ConsumeValueOrDieMethod · 0.80
FillWithYXMethod · 0.80
FillIotaMethod · 0.80
ParameterFunction · 0.50

Tested by

no test coverage detected