Re: [eigen] Tensor reduction with .all() or .any() |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
That's very informative, thanks!I realize that the std::cout call is working because Eigen::Tensor implements output routines to streams, and that is why your example works.However, my aim was to use that _expression_ into a BOOST_TEST condition, and I'm unable to extract the bool value from it, even using Eigen::Tensor::cast<bool>:On Fri, Jun 10, 2022, at 16:58, Antonio Sanchez wrote:The `Eigen::Tensor<bool, 0>` should have worked.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 workbool allTestsPassed = (errors < tolerance).all();I have triedEigen::Tensor<bool, 0> allTestsPassed;andEigen::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--Alberto
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |