tensorflow/compiler/xla/tests/tuple_test.cc
// Disabled on interpreter due to lack of outfeed.
Disabled on interpreter due to lack of outfeed.
Disabled on interpreter due to lack of outfeed .
XLA_TEST_F(TupleHloTest, DISABLED_ON_GPU(DISABLED_ON_INTERPRETER(
                             NonAmbiguousTopLevelAllocation))) {
  const char* testcase = R"(
    HloModule tuple
    ENTRY main {
      a = f32[2] parameter(0)
      b = f32[2] parameter(1)
      c = f32[2] parameter(2)
      d = f32[2] parameter(3)
      cond = pred[] parameter(4)
      tup0 = (f32[2],f32[2]) tuple(a, b)
      tup1 = (f32[2],f32[2]) tuple(c, d)
      s = (f32[2],f32[2]) tuple-select(cond, tup0, tup1)
      gte = f32[2] get-tuple-element(s), index=0
      tuple = (f32[2]) tuple(gte)
      token0 = token[] after-all()
      ROOT outfeed = token[] outfeed(tuple, token0)
    }
  )";
  auto module = ParseAndReturnVerifiedModule(testcase).ValueOrDie();
  auto param0 = LiteralUtil::CreateR1<float>({1, 2});
  auto param1 = LiteralUtil::CreateR1<float>({2, 3});
  auto param4 = LiteralUtil::CreateR0<bool>(false);
  std::unique_ptr<tensorflow::Thread> thread(
      tensorflow::Env::Default()->StartThread(
          tensorflow::ThreadOptions(), "execute_thread", [&] {
            TF_EXPECT_OK(Execute(std::move(module),
                                 {&param0, &param1, &param1, &param0, &param4})
                             .status());
          }));
  auto expected =
      LiteralUtil::MakeTupleOwned(LiteralUtil::CreateR1<float>({2, 3}));
  auto literal = Literal::CreateFromShape(expected.shape());
  TF_EXPECT_OK(backend().transfer_manager()->TransferLiteralFromOutfeed(
      backend().default_stream_executor(), &literal));
  EXPECT_TRUE(LiteralTestUtil::Equal(expected, literal));
}
XLA_TEST_F ( TupleHloTest , DISABLED_ON_GPU ( DISABLED_ON_INTERPRETER ( NonAmbiguousTopLevelAllocation ) ) ) { const char * testcase = R" ( 
    HloModule tuple

    ENTRY main {
      a = f32[2] parameter(0)
      b = f32[2] parameter(1)
      c = f32[2] parameter(2)
      d = f32[2] parameter(3)
      cond = pred[] parameter(4)

      tup0 = (f32[2],f32[2]) tuple(a, b)
      tup1 = (f32[2],f32[2]) tuple(c, d)

      s = (f32[2],f32[2]) tuple-select(cond, tup0, tup1)
      gte = f32[2] get-tuple-element(s), index=0
      tuple = (f32[2]) tuple(gte)
      token0 = token[] after-all()
      ROOT outfeed = token[] outfeed(tuple, token0)
    }
   ) " ; auto module = ParseAndReturnVerifiedModule ( testcase ) . ValueOrDie ( ) ; auto param0 = LiteralUtil :: CreateR1 < float > ( { 1 , 2 } ) ; auto param1 = LiteralUtil :: CreateR1 < float > ( { 2 , 3 } ) ; auto param4 = LiteralUtil :: CreateR0 < bool > ( false ) ; std :: unique_ptr < tensorflow :: Thread > thread ( tensorflow :: Env :: Default ( ) -> StartThread ( tensorflow :: ThreadOptions ( ) , " " , [ & ] { TF_EXPECT_OK ( Execute ( std :: move ( module ) , { & param0 , & param1 , & param1 , & param0 , & param4 } ) . status ( ) ) ; } ) ) ; auto expected = LiteralUtil :: MakeTupleOwned ( LiteralUtil :: CreateR1 < float > ( { 2 , 3 } ) ) ; auto literal = Literal :: CreateFromShape ( expected . shape ( ) ) ; TF_EXPECT_OK ( backend ( ) . transfer_manager ( ) -> TransferLiteralFromOutfeed ( backend ( ) . default_stream_executor ( ) , & literal ) ) ; EXPECT_TRUE ( LiteralTestUtil :: Equal ( expected , literal ) ) ; }
Disabled on interpreter due to lack of outfeed.
Disabled on interpreter due to lack of outfeed .
// Put execution on a separate thread so we can block on outfeed.