提交 2434b8f5 编写于 作者: D Dong Zhihong

" add interface to scopeDesc bind"

上级 3f4177ea
...@@ -27,7 +27,7 @@ VarDescBind *BlockDescBind::Var(const std::string &name) { ...@@ -27,7 +27,7 @@ VarDescBind *BlockDescBind::Var(const std::string &name) {
return var; return var;
} }
VarDescBind *BlockDescBind::Var(const std::string &name) const { VarDescBind *BlockDescBind::FindVar(const std::string &name) const {
auto it = vars_.find(name); auto it = vars_.find(name);
PADDLE_ENFORCE(it != vars_.end(), PADDLE_ENFORCE(it != vars_.end(),
"Can not find variable %s in current block.", name); "Can not find variable %s in current block.", name);
......
...@@ -51,7 +51,7 @@ class BlockDescBind { ...@@ -51,7 +51,7 @@ class BlockDescBind {
VarDescBind *Var(const std::string &name_bytes); 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; bool HasVar(const std::string &var_name) const;
......
...@@ -403,11 +403,11 @@ class CompileTimeInferShapeContext : public InferShapeContext { ...@@ -403,11 +403,11 @@ class CompileTimeInferShapeContext : public InferShapeContext {
private: private:
DDim GetDim(const std::string& name) const override { 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 { 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_; const OpDescBind& op_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册