tensorflow/compiler/xla/tests/reduce_test.cc
// Tests 2D matrix ReduceToRow operation.
Tests 2D matrix ReduceToRow operation.
Tests 2D matrix ReduceToRow operation .
XLA_TEST_F(ReduceTest, Reduce2DAmongY) {
  XlaBuilder builder("reduce_among_y");
  auto m = ConstantLiteral(&builder, literal_2d_);
  auto add = CreateScalarAddComputation(F32, &builder);
  Reduce(m, ConstantR0<float>(&builder, 0.0f), add, {0});
  std::vector<float> expected = {5.f, 7.f, 9.f};
  ComputeAndCompareR1<float>(&builder, expected, {}, ErrorSpec(0.0001));
}
XLA_TEST_F ( ReduceTest , Reduce2DAmongY ) { XlaBuilder builder ( " " ) ; auto m = ConstantLiteral ( & builder , literal_2d_ ) ; auto add = CreateScalarAddComputation ( F32 , & builder ) ; Reduce ( m , ConstantR0 < float > ( & builder , 0.0f ) , add , { 0 } ) ; std :: vector < float > expected = { 5.f , 7.f , 9.f } ; ComputeAndCompareR1 < float > ( & builder , expected , { } , ErrorSpec ( 0.0001 ) ) ; }
Tests 2D matrix ReduceToRow operation.
Tests 2D matrix ReduceToRow operation .