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

Function TEST_F

tensorflow/compiler/xla/service/hlo_dataflow_analysis_test.cc:2039–2060  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2037class DoesNotUseOperandBufferTest : public HloDataflowAnalysisTestBase {};
2038
2039TEST_F(DoesNotUseOperandBufferTest, GetTupleElement) {
2040 auto builder = HloComputation::Builder(TestName());
2041
2042 Shape elem_shape = ShapeUtil::MakeShape(F32, {8});
2043 auto tuple = builder.AddInstruction(HloInstruction::CreateParameter(
2044 0, ShapeUtil::MakeTupleShape({elem_shape, elem_shape}), "tuple"));
2045 auto gte0 = builder.AddInstruction(
2046 HloInstruction::CreateGetTupleElement(elem_shape, tuple, 0));
2047 auto gte1 = builder.AddInstruction(
2048 HloInstruction::CreateGetTupleElement(elem_shape, tuple, 1));
2049 builder.AddInstruction(
2050 HloInstruction::CreateBinary(elem_shape, HloOpcode::kAdd, gte0, gte1));
2051
2052 BuildModuleAndRunAnalysis(builder.Build());
2053
2054 // GetTupleElement instructions only access the top-level buffer of their
2055 // operand.
2056 EXPECT_TRUE(dataflow_analysis_->DoesNotUseOperandBuffer(tuple, {0}, gte0));
2057 EXPECT_TRUE(dataflow_analysis_->DoesNotUseOperandBuffer(tuple, {1}, gte1));
2058 EXPECT_FALSE(dataflow_analysis_->DoesNotUseOperandBuffer(tuple, {}, gte0));
2059 EXPECT_FALSE(dataflow_analysis_->DoesNotUseOperandBuffer(tuple, {}, gte1));
2060}
2061
2062TEST_F(DoesNotUseOperandBufferTest, FusedDynamicUpdateSlice) {
2063 auto builder = HloComputation::Builder(TestName());

Callers

nothing calls this directly

Calls 15

TestNameFunction · 0.85
MakeShapeFunction · 0.85
MakeSortHloFunction · 0.85
root_instructionMethod · 0.80
entry_computationMethod · 0.80
parameter_instructionMethod · 0.80
AddEntryComputationMethod · 0.80
IsLoopFusionMethod · 0.80
BuilderClass · 0.70

Tested by

no test coverage detected