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

Function TEST_F

tensorflow/compiler/xla/service/while_util_test.cc:69–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67};
68
69TEST_F(WhileUtilTest, MakeZeroInstructionsLiveOp) {
70 HloInstruction *param0, *param1, *param2;
71 HloComputation* entry_computation;
72
73 TF_ASSERT_OK_AND_ASSIGN(
74 auto module,
75 GetParsedModule(&entry_computation, &param0, &param1, &param2));
76
77 HloInstruction* while_instr = entry_computation->root_instruction();
78 ASSERT_EQ(while_instr->opcode(), HloOpcode::kWhile);
79
80 TF_ASSERT_OK_AND_ASSIGN(
81 WhileUtil::MakeInstructionsLiveInResult make_live_in_result,
82 WhileUtil::MakeInstructionsLiveIn(while_instr, /*instructions=*/{}));
83
84 HloInstruction* new_while_instr = make_live_in_result.new_while_instr;
85
86 EXPECT_THAT(
87 entry_computation->root_instruction(),
88 op::Tuple(op::GetTupleElement(::testing::Eq(new_while_instr), 0),
89 op::GetTupleElement(::testing::Eq(new_while_instr), 1)));
90
91 auto param_reconstructed =
92 op::Tuple(op::GetTupleElement(op::Parameter(0), 0),
93 op::GetTupleElement(op::Parameter(0), 1));
94
95 EXPECT_THAT(new_while_instr->while_body()->root_instruction(),
96 op::Tuple(op::GetTupleElement(param_reconstructed, 0),
97 op::GetTupleElement(param_reconstructed, 1)));
98}
99
100TEST_F(WhileUtilTest, MakeTwoInstructionsLive) {
101 HloInstruction *param0, *param1, *param2;

Callers

nothing calls this directly

Calls 14

root_instructionMethod · 0.80
opcodeMethod · 0.80
parameter_instructionMethod · 0.80
instructionsMethod · 0.80
GetTupleElementFunction · 0.70
EqFunction · 0.70
ParameterFunction · 0.70
nameMethod · 0.65
TupleFunction · 0.50
while_bodyMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected