From 8c7ee7a5cdc6e959ad55a6a24d3ffe4bc3f37144 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Fri, 6 Oct 2017 11:41:59 -0700 Subject: [PATCH] optimize code --- paddle/framework/block_desc.cc | 3 +-- paddle/framework/shape_inference.h | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/paddle/framework/block_desc.cc b/paddle/framework/block_desc.cc index 670533a3fe3..01f50e13936 100644 --- a/paddle/framework/block_desc.cc +++ b/paddle/framework/block_desc.cc @@ -35,8 +35,7 @@ VarDescBind *BlockDescBind::Var(const std::string &name) const { } bool BlockDescBind::HasVar(const std::string &name) const { - auto it = vars_.find(name); - return it != vars_.end(); + return vars_.find(name) != vars_.end(); } std::vector BlockDescBind::AllVars() const { diff --git a/paddle/framework/shape_inference.h b/paddle/framework/shape_inference.h index bc8af0eb3ec..74e0371e328 100644 --- a/paddle/framework/shape_inference.h +++ b/paddle/framework/shape_inference.h @@ -19,6 +19,9 @@ limitations under the License. */ namespace paddle { namespace framework { +// TODO(longfei): Once after both CompileTimeInferShapeContext and +// RuntimeInferShapeContext get merged, we can rename InferShapeContextBase into +// InferShapeContext so to replace the current InferShapeContext. class InferShapeContextBase { public: virtual ~InferShapeContextBase() {} -- GitLab