| 84 | |
| 85 | |
| 86 | XLA_TEST_P(DepthwiseConvolution2DTest, DoIt) { |
| 87 | const DepthwiseConvolution2DSpec& spec = ::testing::get<0>(GetParam()); |
| 88 | bool use_bfloat16 = ::testing::get<1>(GetParam()); |
| 89 | |
| 90 | #ifdef XLA_BACKEND_DOES_NOT_SUPPORT_BFLOAT16 |
| 91 | if (use_bfloat16) { |
| 92 | return; |
| 93 | } |
| 94 | #endif |
| 95 | |
| 96 | const string hlo_text = |
| 97 | BuildHloTextDepthwiseConvolution2D(spec, use_bfloat16); |
| 98 | |
| 99 | EXPECT_TRUE(RunAndCompare(hlo_text, ErrorSpec{0.01, 0.01}, |
| 100 | [](HloModule* module) -> Status { |
| 101 | BFloat16MixedPrecisionRemoval remover; |
| 102 | TF_RETURN_IF_ERROR(remover.Run(module).status()); |
| 103 | Despecializer despecializer; |
| 104 | return despecializer.Run(module).status(); |
| 105 | })); |
| 106 | } |
| 107 | |
| 108 | INSTANTIATE_TEST_CASE_P( |
| 109 | DepthwiseConvolution2DTestWithRandomIndices, DepthwiseConvolution2DTest, |
nothing calls this directly
no test coverage detected