aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/tests/outfeed_in_nested_computation_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/compiler/xla/tests/outfeed_in_nested_computation_test.cc')
-rw-r--r--tensorflow/compiler/xla/tests/outfeed_in_nested_computation_test.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/tensorflow/compiler/xla/tests/outfeed_in_nested_computation_test.cc b/tensorflow/compiler/xla/tests/outfeed_in_nested_computation_test.cc
index 0a0426adcb..f2460822a6 100644
--- a/tensorflow/compiler/xla/tests/outfeed_in_nested_computation_test.cc
+++ b/tensorflow/compiler/xla/tests/outfeed_in_nested_computation_test.cc
@@ -70,7 +70,7 @@ XLA_TEST_F(OutfeedInNestedComputationTest, OutfeedInWhile) {
GetTupleElement(result_tuple, 0);
TF_ASSERT_OK_AND_ASSIGN(XlaComputation computation, b.Build());
- std::unique_ptr<xla::Literal> comp_result;
+ Literal comp_result;
std::unique_ptr<tensorflow::Thread> thread(
tensorflow::Env::Default()->StartThread(
tensorflow::ThreadOptions(), "execute_thread", [&] {
@@ -81,41 +81,41 @@ XLA_TEST_F(OutfeedInNestedComputationTest, OutfeedInWhile) {
VLOG(1) << "Transferring trip count to computation";
// Transfer number of iterations to Infeed.
TF_ASSERT_OK(
- local_client_->TransferToInfeed(*LiteralUtil::CreateR0<int32_t>(1)));
+ local_client_->TransferToInfeed(LiteralUtil::CreateR0<int32_t>(1)));
// Pick up value from outfeed
{
VLOG(1) << "Reading from condition outfeed";
- TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<Literal> r,
+ TF_ASSERT_OK_AND_ASSIGN(Literal r,
local_client_->TransferFromOutfeed(&int_shape));
- EXPECT_EQ(r->Get<int32>({}), 1);
+ EXPECT_EQ(r.Get<int32>({}), 1);
}
VLOG(1) << "Writing data to infeed";
// Transfer some stuff to Infeed for use inside of loop.
TF_ASSERT_OK(local_client_->TransferToInfeed(
- *LiteralUtil::CreateR1<int32_t>({10, 20})));
+ LiteralUtil::CreateR1<int32_t>({10, 20})));
// Pick up value from outfeed
{
VLOG(1) << "Reading from body outfeed";
- TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<Literal> r,
+ TF_ASSERT_OK_AND_ASSIGN(Literal r,
local_client_->TransferFromOutfeed(&xfeed_shape));
- EXPECT_EQ(r->Get<int32>({0}), 11);
- EXPECT_EQ(r->Get<int32>({1}), 21);
+ EXPECT_EQ(r.Get<int32>({0}), 11);
+ EXPECT_EQ(r.Get<int32>({1}), 21);
}
{
VLOG(1) << "Reading from condition outfeed";
- TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<Literal> r,
+ TF_ASSERT_OK_AND_ASSIGN(Literal r,
local_client_->TransferFromOutfeed(&int_shape));
- EXPECT_EQ(r->Get<int32>({}), 0);
+ EXPECT_EQ(r.Get<int32>({}), 0);
}
// Joins the thread
thread.reset();
- EXPECT_EQ(comp_result->Get<int32>({}), 0);
+ EXPECT_EQ(comp_result.Get<int32>({}), 0);
}
XLA_TEST_F(OutfeedInNestedComputationTest, OutfeedInConditional) {
@@ -145,7 +145,7 @@ XLA_TEST_F(OutfeedInNestedComputationTest, OutfeedInConditional) {
TF_ASSERT_OK_AND_ASSIGN(XlaComputation computation, b.Build());
- std::unique_ptr<xla::Literal> comp_result;
+ Literal comp_result;
std::unique_ptr<tensorflow::Thread> thread(
tensorflow::Env::Default()->StartThread(
tensorflow::ThreadOptions(), "execute_thread", [&] {
@@ -154,12 +154,12 @@ XLA_TEST_F(OutfeedInNestedComputationTest, OutfeedInConditional) {
}));
TF_ASSERT_OK(
- local_client_->TransferToInfeed(*LiteralUtil::CreateR0<bool>(true)));
+ local_client_->TransferToInfeed(LiteralUtil::CreateR0<bool>(true)));
- TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<Literal> r,
+ TF_ASSERT_OK_AND_ASSIGN(Literal r,
local_client_->TransferFromOutfeed(&result_shape));
- EXPECT_EQ(r->Get<bool>({}), true);
+ EXPECT_EQ(r.Get<bool>({}), true);
// Join the thread
thread.reset();