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

Function TEST_F

tensorflow/compiler/xla/service/gather_expander_test.cc:27–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25using GatherExpanderTest = HloTestBase;
26
27TEST_F(GatherExpanderTest, ErrorStatusOnTooManyIndices) {
28 const string hlo_text = R"(
29HloModule TensorFlowGatherMultipleBatchDims
30
31ENTRY main {
32 operand = s32[3,3] parameter(0)
33 indices = s32[2147483647,5] parameter(1)
34 ROOT gather = s32[2147483647,3,5] gather(operand, indices),
35 offset_dims={1},
36 collapsed_slice_dims={1},
37 start_index_map={1},
38 index_vector_dim=2,
39 slice_sizes={3, 1}
40}
41)";
42 TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<HloModule> module,
43 ParseAndReturnVerifiedModule(hlo_text));
44
45 Status status = GatherExpander{}.Run(module.get()).status();
46 EXPECT_EQ(status.code(), tensorflow::error::UNIMPLEMENTED);
47
48 ASSERT_THAT(
49 status.error_message(),
50 ::testing::HasSubstr("Gather operations with more than 2147483647 gather "
51 "indices are not supported."));
52}
53
54TEST_F(GatherExpanderTest, AvoidDegenerateDims) {
55 const string hlo_text = R"(

Callers

nothing calls this directly

Calls 15

MakeShapeFunction · 0.85
instructionsMethod · 0.80
entry_computationMethod · 0.80
opcodeMethod · 0.80
set_op_nameMethod · 0.80
root_instructionMethod · 0.80
metadataMethod · 0.80
TF_ASSERT_OK_AND_ASSIGNFunction · 0.70
HasSubstrFunction · 0.50
RunFunction · 0.50
statusMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected