Skip to content

add SymbolTable for Block#4172

Closed
Superjomn wants to merge 3 commits intoPaddlePaddle:developfrom
Superjomn:block_imp
Closed

add SymbolTable for Block#4172
Superjomn wants to merge 3 commits intoPaddlePaddle:developfrom
Superjomn:block_imp

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

4 participants