| 106 | }; |
| 107 | |
| 108 | XLA_TEST_P(ReduceWindowTest, MismatchedRanksGivesErrorStatus) { |
| 109 | const auto input = CreateConstantFromLiteral( |
| 110 | LiteralUtil::CreateR1<float>({1, 1, 1, 1}), &builder_); |
| 111 | const auto init_value = |
| 112 | CreateConstantFromLiteral(LiteralUtil::CreateR0<float>(0), &builder_); |
| 113 | TF_ASSERT_OK(builder_.first_error()); |
| 114 | ReduceWindow(input, init_value, |
| 115 | CreateScalarAddComputation(FloatType(), &builder_), |
| 116 | /*window_dimensions=*/{1, 2}, |
| 117 | /*window_strides=*/{1}, Padding::kValid); |
| 118 | ASSERT_EQ(builder_.first_error().code(), tensorflow::error::INVALID_ARGUMENT) |
| 119 | << builder_.first_error(); |
| 120 | ASSERT_THAT(builder_.first_error().error_message(), |
| 121 | ::testing::HasSubstr("Want input dimensions size")); |
| 122 | } |
| 123 | |
| 124 | // Regression test for b/68964348. |
| 125 | XLA_TEST_P(ReduceWindowTest, R0ReduceWindow) { |
nothing calls this directly
no test coverage detected