| 41 | }; |
| 42 | |
| 43 | XLA_TEST_F(ScatterTest, TensorFlowScatterV1_Update) { |
| 44 | const string hlo_text = R"( |
| 45 | HloModule TensorFlowScatterV1 |
| 46 | |
| 47 | update_s32 (lhs: s32[], rhs: s32[]) -> s32[] { |
| 48 | lhs = s32[] parameter(0) |
| 49 | ROOT rhs = s32[] parameter(1) |
| 50 | } |
| 51 | |
| 52 | ENTRY main { |
| 53 | operand = s32[3,3] parameter(0) |
| 54 | indices = s32[2] parameter(1) |
| 55 | updates = s32[2,3] parameter(2) |
| 56 | ROOT scatter = s32[3,3] scatter(operand, indices, updates), |
| 57 | to_apply=update_s32, |
| 58 | update_window_dims={1}, |
| 59 | inserted_window_dims={0}, |
| 60 | scatter_dims_to_operand_dims={0}, |
| 61 | index_vector_dim=1 |
| 62 | } |
| 63 | )"; |
| 64 | Literal operand = |
| 65 | LiteralUtil::CreateR2<int32>({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}); |
| 66 | Literal scatter_indices = LiteralUtil::CreateR1<int32>({0, 2}); |
| 67 | Literal updates = LiteralUtil::CreateR2<int32>({{10, 20, 30}, {70, 80, 90}}); |
| 68 | RunTest(hlo_text, &operand, &scatter_indices, &updates); |
| 69 | } |
| 70 | |
| 71 | XLA_TEST_F(ScatterTest, TensorFlowScatterV1_WithFusedAdds) { |
| 72 | const string hlo_text = R"( |
nothing calls this directly
no test coverage detected