From 5485caf7f7d557ec856c3ea8e95ae9f21f2f9ca8 Mon Sep 17 00:00:00 2001 From: Superjom Date: Fri, 4 Aug 2017 11:57:05 +0800 Subject: [PATCH] add EQ --- paddle/platform/enforce.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paddle/platform/enforce.h b/paddle/platform/enforce.h index 60a42c777d1..7e03bf44251 100644 --- a/paddle/platform/enforce.h +++ b/paddle/platform/enforce.h @@ -162,5 +162,10 @@ inline void throw_on_error(T e) { } \ } while (0) +#define PADDLE_ENFORCE_EQ(__VAL0, __VAL1) \ + PADDLE_ENFORCE((__VAL0) == (__VAL1), "enforce %s == %s failed, %s != %s", \ + #__VAL0, #__VAL1, std::to_string(__VAL0), \ + std::to_string(__VAL1)); + } // namespace platform } // namespace paddle -- GitLab