diff --git a/paddle/fluid/framework/op_info.h b/paddle/fluid/framework/op_info.h index 765ca361f61f78de73003e22e38796c39e12d2e5..1297d8de81fe1683333713b17100ab26a27fa985 100644 --- a/paddle/fluid/framework/op_info.h +++ b/paddle/fluid/framework/op_info.h @@ -79,13 +79,9 @@ struct OpInfo { } // some op has no grad_op_maker, add check before use GradOpMaker() - bool HasGradOpMaker() const { - return grad_op_maker_ != nullptr ? true : false; - } + bool HasGradOpMaker() const { return grad_op_maker_ != nullptr; } - bool HasInferInplace() const { - return infer_inplace_ != nullptr ? true : false; - } + bool HasInferInplace() const { return infer_inplace_ != nullptr; } const OpAttrChecker* Checker() const { return checker_; }