Too lengthy implementation of TensorContainsNan and TensorContainsINF
Created by: wangkuiyi
The implementation contains three parts:
-
VisitPlace (35 lines) https://github.com/PaddlePaddle/Paddle/blob/037ce12ee4f3167fc31f2fdd21e5390b42c806b8/paddle/fluid/platform/place.h#L97-L132
-
The CPU implementation of TensorContainsNaN (~100 lines)
-
The CUDA implementation (~100 lines)
There uses about 235 lines of C++ code to test if a tensor contains NaN or INF!