提交 bc664015 编写于 作者: M minqiyang

Polish code

test=develop
上级 0a4b6fc0
...@@ -260,19 +260,19 @@ inline void throw_on_error(T e) { ...@@ -260,19 +260,19 @@ inline void throw_on_error(T e) {
#define PADDLE_JUDGE #define PADDLE_JUDGE
#define __PADDLE_UNARY_COMPARE(COND, ...) \ #define __PADDLE_UNARY_COMPARE(COND, ...) \
do { \ do { \
auto __cond = COND; \ auto __cond = COND; \
if (UNLIKELY(::paddle::platform::is_error(__cond))) { \ if (UNLIKELY(::paddle::platform::is_error(__cond))) { \
::paddle::platform::throw_on_error(__cond, ##__VA_ARGS__); \ ::paddle::platform::throw_on_error(__cond, ##__VA_ARGS__); /* NOLINT */ \
} \ } \
} while (0) } while (0)
#ifndef REPLACE_ENFORCE_GLOG #ifndef REPLACE_ENFORCE_GLOG
#define PADDLE_ENFORCE(COND, ...) \ #define PADDLE_ENFORCE(COND, ...) \
do { \ do { \
try { \ try { \
__PADDLE_UNARY_COMPARE(COND, ##__VA_ARGS__); \ __PADDLE_UNARY_COMPARE(COND, ##__VA_ARGS__); /* NOLINT */ \
} catch (...) { \ } catch (...) { \
throw ::paddle::platform::EnforceNotMet(std::current_exception(), \ throw ::paddle::platform::EnforceNotMet(std::current_exception(), \
__FILE__, __LINE__); \ __FILE__, __LINE__); \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册