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

Function TEST_F

tensorflow/compiler/xla/service/stable_sort_expander_test.cc:83–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83TEST_F(StableSortExpanderTest, StabilizeSortReuseIotaOperand) {
84 const char* hlo_string = R"(
85 HloModule permutation_sort
86
87 compare {
88 p.0.lhs = f32[] parameter(0)
89 p.0.rhs = f32[] parameter(1)
90 p.1.lhs = s32[] parameter(2)
91 p.1.rhs = s32[] parameter(3)
92 ROOT lt = pred[] compare(p.0.lhs, p.0.rhs), direction=LT
93 }
94
95 ENTRY sort_computation {
96 keys = f32[64,8732]{1,0} parameter(0)
97 values = s32[64,8732]{1,0} iota(), iota_dimension=1
98 sort = (f32[64,8732]{1,0}, s32[64,8732]{1,0}) sort(keys, values),
99 dimensions={1}, to_apply=compare, is_stable=true
100 ROOT gte = f32[64,8732]{1,0} get-tuple-element(sort), index=0
101 })";
102 TF_ASSERT_OK_AND_ASSIGN(auto module,
103 ParseAndReturnVerifiedModule(hlo_string));
104
105 StableSortExpander stabilizer;
106 EXPECT_TRUE(stabilizer.Run(module.get()).ValueOrDie());
107 auto root = module->entry_computation()->root_instruction();
108 EXPECT_THAT(root, GmockMatch(m::GetTupleElement(
109 m::Sort(m::Parameter(0), m::Iota()), 0)));
110 CheckComputationHasTieBreaker(
111 root->operand(0)->to_apply()->root_instruction(), /*iota_parameter=*/1);
112}
113
114TEST_F(StableSortExpanderTest,
115 StabilizeSortReuseIotaOperandComplicatedComparison) {

Callers

nothing calls this directly

Calls 15

GmockMatchFunction · 0.85
NegateFunction · 0.85
root_instructionMethod · 0.80
entry_computationMethod · 0.80
to_applyMethod · 0.80
GetTupleElementFunction · 0.70
ParameterFunction · 0.70
SortFunction · 0.50
IotaFunction · 0.50
TupleFunction · 0.50

Tested by

no test coverage detected