Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

Superjomn
Copy link
Contributor

@Superjomn Superjomn commented Sep 19, 2017

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

namespace paddle {
namespace framework {

const OpDesc* SymbolTable::NewOp() {
Copy link
Member

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?

Copy link
Contributor Author

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.

return &(it->second);
}
if (recursive) {
return parent_->FindVar(name, true);
Copy link
Member

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_;
Copy link
Collaborator

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) {}
Copy link
Collaborator

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?

@wangkuiyi
Copy link
Collaborator

It seems that due to the merge of #4241, this PR could be closed? @Superjom

@Superjomn Superjomn closed this Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

block implementation
4 participants