tensorflow/compiler/xla/tests/reduce_test.cc
// Reduces a matrix among dimension 1.
Reduces a matrix among dimension 1.
Reduces a matrix among dimension 1 .
XLA_TEST_F(ReduceTest, Reduce2DAmong1) {
  XlaBuilder builder(TestName());
  auto m = ConstantLiteral(&builder, literal_2d_);
  auto add = CreateScalarAddComputation(F32, &builder);
  Reduce(m, ConstantR0<float>(&builder, 0.0f), add, {1});
  std::vector<float> expected = {6.f, 15.f};
  ComputeAndCompareR1<float>(&builder, expected, {}, ErrorSpec(0.0001));
}
XLA_TEST_F ( ReduceTest , Reduce2DAmong1 ) { XlaBuilder builder ( TestName ( ) ) ; auto m = ConstantLiteral ( & builder , literal_2d_ ) ; auto add = CreateScalarAddComputation ( F32 , & builder ) ; Reduce ( m , ConstantR0 < float > ( & builder , 0.0f ) , add , { 1 } ) ; std :: vector < float > expected = { 6.f , 15.f } ; ComputeAndCompareR1 < float > ( & builder , expected , { } , ErrorSpec ( 0.0001 ) ) ; }
Reduces a matrix among dimension 1.
Reduces a matrix among dimension 1 .