Test true and false computations that do not take any parameters.
| 177 | |
| 178 | // Test true and false computations that do not take any parameters. |
| 179 | XLA_TEST_F(ConditionalOpTest, Parameters0) { |
| 180 | XlaBuilder builder(TestName()); |
| 181 | XlaOp pred; |
| 182 | auto pred_arg = CreateR0Parameter<bool>(true, 0, "pred", &builder, &pred); |
| 183 | auto operands = Tuple(&builder, {}); |
| 184 | auto true_computation = CreateR0ConstantComputation(56.0f); |
| 185 | auto false_computation = CreateR0ConstantComputation(12.0f); |
| 186 | Conditional(pred, operands, true_computation, operands, false_computation); |
| 187 | |
| 188 | ComputeAndCompareR0<float>(&builder, 56.0f, {pred_arg.get()}, error_spec_); |
| 189 | } |
| 190 | |
| 191 | // Test branch computations that do not take any parameters. |
| 192 | XLA_TEST_P(CaseOpTest, Parameters0) { |
nothing calls this directly
no test coverage detected