| 1674 | public ::testing::WithParamInterface<bool> {}; |
| 1675 | |
| 1676 | XLA_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 | |
| 1713 | INSTANTIATE_TEST_CASE_P(ConvolveWithAndWithoutCanonicalization_Instantiation, |
| 1714 | ConvolveWithAndWithoutCanonicalization, |
nothing calls this directly
no test coverage detected