Use `bool` for PADDLE_ENFORCE, not int

* If stat is an integer, bool value will implicit cast to int before
  pass to PADDLE_ENFORCE
update-doc-pybind
Yu Yang 8 years ago
parent 17827d7e61
commit 699dbe3be9

@ -107,7 +107,7 @@ struct EnforceNotMet : public std::exception {
template <typename... Args> template <typename... Args>
inline typename std::enable_if<sizeof...(Args) != 0, void>::type throw_on_error( inline typename std::enable_if<sizeof...(Args) != 0, void>::type throw_on_error(
int stat, const Args&... args) { bool stat, const Args&... args) {
if (UNLIKELY(!(stat))) { if (UNLIKELY(!(stat))) {
throw std::runtime_error(string::Sprintf(args...)); throw std::runtime_error(string::Sprintf(args...));
} }

Loading…
Cancel
Save