| 167 | }; |
| 168 | |
| 169 | TEST_F(MapTest, MapEachElemPlusOneR0) { |
| 170 | // Applies lambda (x) (+ x 1)) to an input scalar. |
| 171 | XlaBuilder builder(TestName()); |
| 172 | Literal param0_literal = LiteralUtil::CreateR0<float>(42.0); |
| 173 | std::unique_ptr<GlobalData> param0_data = |
| 174 | client_->TransferToServer(param0_literal).ConsumeValueOrDie(); |
| 175 | |
| 176 | auto param = Parameter(&builder, 0, param0_literal.shape(), "param0"); |
| 177 | Map(&builder, {param}, CreateAdderToOne(), {}); |
| 178 | |
| 179 | ComputeAndCompareR0<float>(&builder, 43.0, {param0_data.get()}, |
| 180 | ErrorSpec(0.01f)); |
| 181 | } |
| 182 | |
| 183 | XLA_TEST_F(MapTest, MapEachElemPlusOneR1S0) { |
| 184 | // Maps (lambda (x) (+ x 1)) onto an input R1F32 vector of length 0. |
nothing calls this directly
no test coverage detected