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

Function TEST_F

tensorflow/compiler/xla/service/buffer_assignment_test.cc:340–356  ·  view source on GitHub ↗

Tests a computation consisting of a single scalar constant node.

Source from the content-addressed store, hash-verified

338
339// Tests a computation consisting of a single scalar constant node.
340TEST_F(BufferAssignmentTest, ScalarConstant) {
341 auto builder = HloComputation::Builder(TestName());
342 auto const0 = builder.AddInstruction(
343 HloInstruction::CreateConstant(LiteralUtil::CreateR0<float>(1.0)));
344 auto module = CreateNewVerifiedModule();
345 module->AddEntryComputation(builder.Build());
346
347 {
348 auto buffers = RunBufferAssignment(module.get());
349 EXPECT_TRUE(buffers->HasTopLevelAllocation(const0));
350 }
351
352 {
353 auto buffers = RunBufferAssignmentNoBuffersForConstants(module.get());
354 EXPECT_FALSE(buffers->HasTopLevelAllocation(const0));
355 }
356}
357
358TEST_F(BufferAssignmentTest, BufferForConst) {
359 // Addition of two vector constants: checks that internal constant nodes have

Callers

nothing calls this directly

Calls 15

TestNameFunction · 0.85
ColorClass · 0.85
MakeShapeFunction · 0.85
GetInstructionsFunction · 0.85
BuffersDistinctFunction · 0.85
RunCopyInsertionFunction · 0.85
CreateTokenFunction · 0.85
GetDebugOptionsFromFlagsFunction · 0.85
ScheduleModuleFunction · 0.85
FindInstructionFunction · 0.85
AddEntryComputationMethod · 0.80
HasTopLevelAllocationMethod · 0.80

Tested by

no test coverage detected