diff --git a/paddle/platform/enforce.h b/paddle/platform/enforce.h index 60a42c777d1c2ebbc22fdb77b1100cc6fcf7ff35..7e03bf44251d83bea5a42d6d8c9a17b148418b07 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