PADDLE_ENFORCE need to enable output of function calling stack
Created by: Superjomn
When debugging program, I get following error:
The exception gives a line number which points to an underlying tool function, but this is no help, what I really want is to find out what the caller function is.
If I replace this line's PADDLE_ENFORCE
to GLOG's CHECK
, it works as expected:
The frame 10's log is what I really want, but an exception can only tell me frame 9 get an error.
So
- whether an exception given by
PADDLE_ENFORCE
can give enough debug info like GLOG's `CHECK'? - If no, because debug info is necessary to the developer, can we add a switch into
PADDLE_ENFORCE
macro and switch between exception and CHECK? - I found that the core codes of TensorFlow used CHECK, but the wrapper use exception, so there must be some principle, not to use exception across the whole project.