-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add SymbolTable for Block #4172
Conversation
namespace paddle { | ||
namespace framework { | ||
|
||
const OpDesc* SymbolTable::NewOp() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does not really new an Op?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New a Op Desc, SymbolTable is a container of compile-time instances, this op means an op in compile-time, that is a OpDesc.
paddle/framework/block.cc
Outdated
return &(it->second); | ||
} | ||
if (recursive) { | ||
return parent_->FindVar(name, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should judge if parent_ is null
private: | ||
SymbolTable* parent_{nullptr}; | ||
std::vector<OpDesc> ops_; | ||
std::map<std::string, VarDesc> vars_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unordered_map
class SymbolTable { | ||
public: | ||
SymbolTable() {} | ||
explicit SymbolTable(SymbolTable* parent) : parent_(parent) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is deconstructor, should we disable the Copy & Assign
?
It seems that due to the merge of #4241, this PR could be closed? @Superjom |
This is one part of Block's Implementation according to compile period of block design.
The block's implementation will be split into several stages, this is the first one which supports block's compile, to enable InferShape's development to be done parallel.
resolves: #4171