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

Function TEST_F

tensorflow/compiler/xla/service/hlo_schedule_test.cc:39–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37class HloScheduleTest : public HloTestBase {};
38
39TEST_F(HloScheduleTest, UpdateScheduleUnchangedModule) {
40 // Updating the schedule of an unchanged HLO module should not affect the
41 // schedule at all.
42 const string module_str = R"(
43HloModule UpdateScheduleUnchanged
44
45ENTRY main {
46 a = f32[] parameter(0)
47 b = f32[] parameter(1)
48 c = f32[] constant(42.0)
49 sum = f32[] add(a, b)
50 neg = f32[] negate(c)
51 ROOT root = f32[] multiply(sum, neg)
52}
53)";
54 TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<HloModule> module,
55 ParseAndReturnVerifiedModule(module_str));
56 TF_ASSERT_OK_AND_ASSIGN(
57 HloSchedule schedule,
58 ScheduleModule(module.get(), [](const BufferValue& buffer) {
59 return ShapeUtil::ByteSizeOf(buffer.shape());
60 }));
61 const auto& entry_schedule =
62 schedule.sequence(module->entry_computation()).instructions();
63
64 EXPECT_EQ(entry_schedule.size(), 6);
65
66 TF_ASSERT_OK(schedule.Update());
67 TF_ASSERT_OK(schedule.Verify());
68
69 EXPECT_EQ(entry_schedule,
70 schedule.sequence(module->entry_computation()).instructions());
71}
72
73TEST_F(HloScheduleTest, UpdateScheduleWithNewInstructions) {
74 // Add some additional instructions to a module and verify the schedule can be

Callers

nothing calls this directly

Calls 15

MakeShapeFunction · 0.85
instructionsMethod · 0.80
sequenceMethod · 0.80
entry_computationMethod · 0.80
root_instructionMethod · 0.80
set_root_instructionMethod · 0.80
parameter_instructionMethod · 0.80
while_conditionMethod · 0.80
mutable_operandMethod · 0.80
ReplaceAllUsesWithMethod · 0.80
TF_ASSERT_OK_AND_ASSIGNFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected