tensorflow/compiler/xla/tests/tuple_test.cc
// Tests a tuple-shaped constant.
Tests a tuple-shaped constant.
Tests a tuple - shaped constant .
XLA_TEST_F(TupleTest, TupleConstant) {
  XlaBuilder builder(TestName());
  const float constant_scalar = 7.3f;
  std::initializer_list<float> constant_vector = {1.1f, 2.0f, 3.3f};
  std::initializer_list<std::initializer_list<float>> constant_matrix = {
      {1.1f, 2.2f, 3.5f},  
      {4.8f, 5.0f, 6.7f},  
  };
  auto value = LiteralUtil::MakeTupleFromSlices(
      {LiteralUtil::CreateR0<float>(constant_scalar),
       LiteralUtil::CreateR1<float>(constant_vector),
       LiteralUtil::CreateR2<float>(constant_matrix)});
  ConstantLiteral(&builder, value);
  ComputeAndCompareTuple(&builder, value, {}, error_spec_);
}
XLA_TEST_F ( TupleTest , TupleConstant ) { XlaBuilder builder ( TestName ( ) ) ; const float constant_scalar = 7.3f ; std :: initializer_list < float > constant_vector = { 1.1f , 2.0f , 3.3f } ; std :: initializer_list < std :: initializer_list < float > > constant_matrix = { { 1.1f , 2.2f , 3.5f } , { 4.8f , 5.0f , 6.7f } , } ; auto value = LiteralUtil :: MakeTupleFromSlices ( { LiteralUtil :: CreateR0 < float > ( constant_scalar ) , LiteralUtil :: CreateR1 < float > ( constant_vector ) , LiteralUtil :: CreateR2 < float > ( constant_matrix ) } ) ; ConstantLiteral ( & builder , value ) ; ComputeAndCompareTuple ( & builder , value , { } , error_spec_ ) ; }
Tests a tuple-shaped constant.
Tests a tuple - shaped constant .
// row 0 // row 1