Re: [eigen] Tensor reduction with .all() or .any()

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


The `Eigen::Tensor<bool, 0>` should have worked.

https://godbolt.org/z/zs9hMrne1

On Fri, Jun 10, 2022 at 4:40 AM Alberto Luaces <eigen@xxxxxxxxxxxxxxxxxxxx> wrote:
Hello, I'm having problems trying to find if some condition is failing for any of the elements of a tensor:

Eigen::Tensor<double, 5> errors(21, 21, 21, 21, 21);

....

// This does not work
bool allTestsPassed = (errors < tolerance).all();

I have tried

Eigen::Tensor<bool, 0> allTestsPassed;

 and

Eigen::Tensor<bool, 1> allTestsPassed(1);

but I cannot get the result, either because there are compilation errors or either I have runtime size mismatches when assigning the value of allTestsPassed variable.

Thanks.

--
  Alberto




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/