From c20b11ba11c021ecdb3bef95d5821a9e15419316 Mon Sep 17 00:00:00 2001 From: Zeng Jinle <32832641+sneaxiy@users.noreply.github.com> Date: Thu, 10 Oct 2019 09:45:50 +0800 Subject: [PATCH] simplify op_info.h, test=develop (#20195) --- paddle/fluid/framework/op_info.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/framework/op_info.h b/paddle/fluid/framework/op_info.h index 765ca361f61..1297d8de81f 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_; } -- GitLab