From 699dbe3be9fd3020fe44d1401f5d1a492d98e40b Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Mon, 25 Sep 2017 11:38:16 -0700 Subject: [PATCH] Use `bool` for PADDLE_ENFORCE, not int * If stat is an integer, bool value will implicit cast to int before pass to PADDLE_ENFORCE --- paddle/platform/enforce.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/platform/enforce.h b/paddle/platform/enforce.h index df5f71ed76..b523ef03c0 100644 --- a/paddle/platform/enforce.h +++ b/paddle/platform/enforce.h @@ -107,7 +107,7 @@ struct EnforceNotMet : public std::exception { template inline typename std::enable_if::type throw_on_error( - int stat, const Args&... args) { + bool stat, const Args&... args) { if (UNLIKELY(!(stat))) { throw std::runtime_error(string::Sprintf(args...)); } -- GitLab