mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Redundant condition (#32396)
Summary: Optimize expression: 'A || (!A && B)' <=> 'A || B' A: relErr <= maxRelErr !A : relErr > maxRelErr B: absErr <= absErrForRelErrFailure Pull Request resolved: https://github.com/pytorch/pytorch/pull/32396 Differential Revision: D19499370 Pulled By: ezyang fbshipit-source-id: c19bdcb2d4e7ff7806a8cd181c6e7e9e276b9979
This commit is contained in:
parent
839fe714de
commit
ec4be4e58c
|
|
@ -140,8 +140,7 @@ void compare(int N, int inputC, int H, int W,
|
|||
// For small values / small difference, the relative error
|
||||
// can be huge but the absolute error will be small
|
||||
EXPECT_TRUE(relErr <= maxRelErr ||
|
||||
(relErr > maxRelErr &&
|
||||
absErr <= absErrForRelErrFailure)) <<
|
||||
(absErr <= absErrForRelErrFailure)) <<
|
||||
v1 << " " << v2 << " (rel err " << relErr << ") " <<
|
||||
"(" << n << " " << c << " " << h << " " << w << ") " <<
|
||||
"running N " << N << " inputC " << inputC <<
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user