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

Function XLA_TEST_P

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

Source from the content-addressed store, hash-verified

1674 public ::testing::WithParamInterface<bool> {};
1675
1676XLA_TEST_P(ConvolveWithAndWithoutCanonicalization,
1677 DISABLED_ON_GPU(Convolve2D_NoSpatialDims)) {
1678 if (GetParam()) {
1679 execution_options_.mutable_debug_options()->add_xla_disable_hlo_passes(
1680 "convolution-canonicalization");
1681 }
1682 XlaBuilder builder(TestName());
1683 Shape input_shape = ShapeUtil::MakeShape(F32, {4, 29});
1684 Shape filter_shape = ShapeUtil::MakeShape(F32, {4, 10});
1685
1686 auto input = Parameter(&builder, 0, input_shape, "input");
1687 auto filter = Parameter(&builder, 1, filter_shape, "filter");
1688
1689 ConvolutionDimensionNumbers dnums;
1690 dnums.set_input_feature_dimension(0);
1691 dnums.set_input_batch_dimension(1);
1692 dnums.set_kernel_input_feature_dimension(0);
1693 dnums.set_kernel_output_feature_dimension(1);
1694 dnums.set_output_batch_dimension(0);
1695 dnums.set_output_feature_dimension(1);
1696 ConvWithGeneralDimensions(input, filter, {}, Padding::kValid, dnums);
1697
1698 Array2D<float> param0(4, 29);
1699 param0.FillUnique();
1700
1701 Array2D<float> param1(4, 10);
1702 param1.FillUnique();
1703
1704 Array2D<float> expected_result(29, 10);
1705 expected_result.Fill(0);
1706
1707 ComputeAndCompare(&builder,
1708 {LiteralUtil::CreateFromArray(param0),
1709 LiteralUtil::CreateFromArray(param1)},
1710 error_spec_);
1711}
1712
1713INSTANTIATE_TEST_CASE_P(ConvolveWithAndWithoutCanonicalization_Instantiation,
1714 ConvolveWithAndWithoutCanonicalization,

Callers

nothing calls this directly

Calls 8

GetParamFunction · 0.85
TestNameFunction · 0.85
MakeShapeFunction · 0.85
FillUniqueMethod · 0.80
ParameterFunction · 0.50
mutable_debug_optionsMethod · 0.45
FillMethod · 0.45

Tested by

no test coverage detected