tensorflow/compiler/xla/tests/tuple_test.cc
// Trivial test for extracting a tuple element with GetTupleElement.
Trivial test for extracting a tuple element with GetTupleElement.
Trivial test for extracting a tuple element with GetTupleElement .
XLA_TEST_F(TupleTest, GetTupleElement) {
  XlaBuilder builder(TestName());
  std::initializer_list<float> constant_vector = {1.f, 2.f, 3.f};
  std::initializer_list<std::initializer_list<float>> constant_matrix = {
      {1.f, 2.f, 3.f},  
      {4.f, 5.f, 6.f},  
  };
  auto tuple_data =
      Tuple(&builder, {ConstantR1<float>(&builder, constant_vector),
                       ConstantR2<float>(&builder, constant_matrix)});
  GetTupleElement(tuple_data, 1);
  ComputeAndCompareR2<float>(&builder, Array2D<float>(constant_matrix), {},
                             error_spec_);
}
XLA_TEST_F ( TupleTest , GetTupleElement ) { XlaBuilder builder ( TestName ( ) ) ; std :: initializer_list < float > constant_vector = { 1.f , 2.f , 3.f } ; std :: initializer_list < std :: initializer_list < float > > constant_matrix = { { 1.f , 2.f , 3.f } , { 4.f , 5.f , 6.f } , } ; auto tuple_data = Tuple ( & builder , { ConstantR1 < float > ( & builder , constant_vector ) , ConstantR2 < float > ( & builder , constant_matrix ) } ) ; GetTupleElement ( tuple_data , 1 ) ; ComputeAndCompareR2 < float > ( & builder , Array2D < float > ( constant_matrix ) , { } , error_spec_ ) ; }
Trivial test for extracting a tuple element with GetTupleElement.
Trivial test for extracting a tuple element with GetTupleElement .
// row 0 // row 1