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

Function TEST_F

tensorflow/compiler/xla/service/copy_insertion_test.cc:86–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84};
85
86TEST_F(CopyInsertionTest, SingleParameter) {
87 // Computation is a single parameter passed into a tuple. The parameter should
88 // be copied before entering the tuple.
89 auto builder = HloComputation::Builder(TestName());
90 HloInstruction* x = builder.AddInstruction(
91 HloInstruction::CreateParameter(0, ShapeUtil::MakeShape(F32, {}), "x"));
92 HloInstruction* tuple =
93 builder.AddInstruction(HloInstruction::CreateTuple({x}));
94
95 EXPECT_THAT(x->users(), UnorderedElementsAre(tuple));
96
97 auto module = CreateNewVerifiedModule();
98 module->AddEntryComputation(builder.Build());
99
100 InsertCopies(module.get());
101
102 EXPECT_THAT(module->entry_computation()->root_instruction(),
103 op::Tuple(op::Copy(x)));
104}
105
106TEST_F(CopyInsertionTest, SingleConstant) {
107 // Computation is a single constant passed into a tuple. The parameter should

Callers

nothing calls this directly

Calls 15

TestNameFunction · 0.85
MakeShapeFunction · 0.85
CopyFunction · 0.85
CountControlEdgesFunction · 0.85
BroadcastFunction · 0.85
NegateFunction · 0.85
AddEntryComputationMethod · 0.80
root_instructionMethod · 0.80
entry_computationMethod · 0.80
mutable_layoutMethod · 0.80
opcodeMethod · 0.80

Tested by

no test coverage detected