[eigen] Tensor reduction with .all() or .any() |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Tensor reduction with .all() or .any()
- From: "Alberto Luaces" <eigen@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 10 Jun 2022 13:38:27 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t= 1654861133; x=1654947533; bh=kk7YkLNGECoQasoDQBk/LvvmtmYxbIVTw8x oW1bhNEo=; b=KhDyT/9toc741lYyvv+HapuWfnti/u3tzEBmfy+yyjT4F/qe2O3 TBQTc/HfzIm7bCj5koJkZEOJJL3naKdQuOz2IJx07z5I79VXFnfJKNPLGlpgJowy 48rEVqjFjT0KHBNFxbPcRCkPip48RTag9tzyirZSQj08QBEDF3IhP4QWVDNjnPMg bSUOsvadXgQg34oDYvHUzZcZKI0y3HqnEcFjjfhvqmNMwjj7ydqnl7RwyNMqpInb S+AOB49DCeUPc096JAFclsPZmFYgCFkLd3sH+upeTkI76hWl58LTiK5LtMHFSidK FdgFFUyaNOG6efqdM/h5gqtCP+X75hL75fw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1654861133; x= 1654947533; bh=kk7YkLNGECoQasoDQBk/LvvmtmYxbIVTw8xoW1bhNEo=; b=k RmOQCPUmc1eH4Lf3fF07qdhHnXuGAQ7CLNd5PV8C9XtBzF+02fyqMzkNemZIbjRe DacVlLGARiqamddveUmJKv3DSVO8SLfPaDMZu85fl0WzhhwbcNeq0yqohIOy1knq 3ShxOrp3EofPO28xXIdFF3CMqsg09jZBgmD4eLcNcVyKk1IwQORxY9Oe97vB4njD Ud4ZYYQzzQpjTzelm6IgzSNU6eM8OqDlSBX4AXvzD2tVqmFhjgPPMjfgD0xn1O9p iOi3X8biY6RYj/2QPBk5Z4/3whPQIhyjh/1hT/6oWdeBOyhV1ZjPKYn53gd4N+tm d4rcGOL/LeBPeAr3mRn8Q==
- Feedback-id: i68d94250:Fastmail
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