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

Function TEST_F

tensorflow/compiler/xla/tests/deconstruct_tuple_test.cc:55–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53};
54
55TEST_F(DeconstructTupleTest, DeconstructTuple) {
56 XlaBuilder builder(TestName());
57 auto const1 = ConstantR1<float>(&builder, {1.0, 2.0, 3.0, 4.0});
58 auto const2 = ConstantR1<float>(&builder, {2.0, 4.0, 6.0, 8.0});
59 Tuple(&builder, {const1, const2});
60 auto global_data = ExecuteAndCheckTransfer(&builder, {});
61
62 auto result_status = client_->DeconstructTuple(*global_data);
63 EXPECT_TRUE(result_status.ok());
64
65 // Try copying the elements back and comparing it
66 auto handles = result_status.ConsumeValueOrDie();
67 Literal literal;
68 TF_ASSERT_OK_AND_ASSIGN(literal, client_->Transfer(*handles[0]));
69 LiteralTestUtil::ExpectR1Equal<float>({1.0, 2.0, 3.0, 4.0}, literal);
70 TF_ASSERT_OK_AND_ASSIGN(literal, client_->Transfer(*handles[1]));
71 LiteralTestUtil::ExpectR1Equal<float>({2.0, 4.0, 6.0, 8.0}, literal);
72}
73
74TEST_F(DeconstructTupleTest, DeconstructTupleTwice) {
75 XlaBuilder builder(TestName());

Callers

nothing calls this directly

Calls 9

TestNameFunction · 0.85
ConsumeValueOrDieMethod · 0.80
TransferMethod · 0.80
TupleFunction · 0.50
TF_ASSERT_OK_AND_ASSIGNFunction · 0.50
DeconstructTupleMethod · 0.45
okMethod · 0.45
resetMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected