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

Method TestCopyOp

tensorflow/compiler/xla/tests/copy_test.cc:41–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39class CopyOpTest : public HloTestBase {
40 protected:
41 void TestCopyOp(const Literal& literal) {
42 auto builder = HloComputation::Builder(TestName());
43 auto constant =
44 builder.AddInstruction(HloInstruction::CreateConstant(literal.Clone()));
45 builder.AddInstruction(HloInstruction::CreateUnary(
46 constant->shape(), HloOpcode::kCopy, constant));
47 auto computation = builder.Build();
48 auto module = CreateNewVerifiedModule();
49 module->AddEntryComputation(std::move(computation));
50
51 Literal result = ExecuteAndTransfer(std::move(module), {});
52 EXPECT_TRUE(LiteralTestUtil::Equal(literal, result));
53 }
54
55 void TestCopyConstantLayout021(size_t n1, size_t n2, size_t n3);
56 void TestCopyConstantLayoutR4(size_t n1, size_t n2, size_t n3, size_t n4,

Callers

nothing calls this directly

Calls 8

TestNameFunction · 0.85
AddEntryComputationMethod · 0.80
BuilderClass · 0.50
EqualClass · 0.50
AddInstructionMethod · 0.45
CloneMethod · 0.45
shapeMethod · 0.45
BuildMethod · 0.45

Tested by

no test coverage detected