From 2434b8f5fb51f172b1aae4c66dfe1d9663dae363 Mon Sep 17 00:00:00 2001 From: Dong Zhihong Date: Sat, 14 Oct 2017 11:26:14 -0700 Subject: [PATCH] " add interface to scopeDesc bind" --- paddle/framework/block_desc.cc | 2 +- paddle/framework/block_desc.h | 2 +- paddle/framework/operator.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/paddle/framework/block_desc.cc b/paddle/framework/block_desc.cc index 2dbf54301..e71eb3cb5 100644 --- a/paddle/framework/block_desc.cc +++ b/paddle/framework/block_desc.cc @@ -27,7 +27,7 @@ VarDescBind *BlockDescBind::Var(const std::string &name) { return var; } -VarDescBind *BlockDescBind::Var(const std::string &name) const { +VarDescBind *BlockDescBind::FindVar(const std::string &name) const { auto it = vars_.find(name); PADDLE_ENFORCE(it != vars_.end(), "Can not find variable %s in current block.", name); diff --git a/paddle/framework/block_desc.h b/paddle/framework/block_desc.h index 18af157b6..1dd18a902 100644 --- a/paddle/framework/block_desc.h +++ b/paddle/framework/block_desc.h @@ -51,7 +51,7 @@ class BlockDescBind { VarDescBind *Var(const std::string &name_bytes); - VarDescBind *Var(const std::string &name_bytes) const; + VarDescBind *FindVar(const std::string &name_bytes) const; bool HasVar(const std::string &var_name) const; diff --git a/paddle/framework/operator.h b/paddle/framework/operator.h index 97a142d5f..cf15f9933 100644 --- a/paddle/framework/operator.h +++ b/paddle/framework/operator.h @@ -403,11 +403,11 @@ class CompileTimeInferShapeContext : public InferShapeContext { private: DDim GetDim(const std::string& name) const override { - return framework::make_ddim(block_.Var(name)->Shape()); + return framework::make_ddim(block_.FindVar(name)->Shape()); } void SetDim(const std::string& name, const DDim& dim) override { - block_.Var(name)->SetShape(framework::vectorize(dim)); + block_.FindVar(name)->SetShape(framework::vectorize(dim)); } const OpDescBind& op_; -- GitLab