MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / XLA_TEST_F

Function XLA_TEST_F

tensorflow/compiler/xla/tests/scatter_test.cc:43–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41};
42
43XLA_TEST_F(ScatterTest, TensorFlowScatterV1_Update) {
44 const string hlo_text = R"(
45HloModule TensorFlowScatterV1
46
47update_s32 (lhs: s32[], rhs: s32[]) -> s32[] {
48 lhs = s32[] parameter(0)
49 ROOT rhs = s32[] parameter(1)
50}
51
52ENTRY 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
71XLA_TEST_F(ScatterTest, TensorFlowScatterV1_WithFusedAdds) {
72 const string hlo_text = R"(

Callers

nothing calls this directly

Calls 4

set_debug_optionsMethod · 0.80
RunTestFunction · 0.50
TF_ASSERT_OK_AND_ASSIGNFunction · 0.50
EqualClass · 0.50

Tested by

no test coverage detected