From 010f657b336944556d190d9054c328a7dc6e87c9 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Mon, 24 Dec 2018 18:31:54 +0800 Subject: [PATCH] Polish code test=develop --- paddle/fluid/operators/detail/safe_ref.h | 2 +- paddle/fluid/platform/enforce.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/detail/safe_ref.h b/paddle/fluid/operators/detail/safe_ref.h index a800d5df0..8660bc219 100644 --- a/paddle/fluid/operators/detail/safe_ref.h +++ b/paddle/fluid/operators/detail/safe_ref.h @@ -25,7 +25,7 @@ namespace detail { */ template inline T& Ref(T* ptr, ARGS&&... args) { - PADDLE_ENFORCE(ptr != nullptr, args...); + PADDLE_ENFORCE(ptr != nullptr, ::paddle::string::Sprintf(args...)); return *ptr; } diff --git a/paddle/fluid/platform/enforce.h b/paddle/fluid/platform/enforce.h index 7eb4be213..e9b98aee1 100644 --- a/paddle/fluid/platform/enforce.h +++ b/paddle/fluid/platform/enforce.h @@ -298,7 +298,7 @@ inline void throw_on_error(T e) { #define __PADDLE_ENFORCE_I(COND, ...) __PADDLE_UNARY_COMPARE(COND, __VA_ARGS__); #endif // REPLACE_ENFORCE_GLOG -#define __PADDLE_ENFORCE(args) __PADDLE_ENFORCE_I args +#define __PADDLE_ENFORCE(__args) __PADDLE_ENFORCE_I __args #define PADDLE_ENFORCE(...) __PADDLE_ENFORCE((__VA_ARGS__)) #define PADDLE_THROW_EOF() \ -- GitLab