Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
Remove net_def_ from NetBase
Browse files Browse the repository at this point in the history
Summary: Constructor should extract everything needed from NetDef instead of keeping it for usage after construction.

Reviewed By: akyrola

Differential Revision: D5469095

fbshipit-source-id: 288ea3243d85061ba9c018d2aef3b4d97485dd00
  • Loading branch information
bddppq authored and facebook-github-bot committed Jul 21, 2017
1 parent 5d6debb commit c340c20
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
3 changes: 1 addition & 2 deletions caffe2/core/net.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ NetBase::NetBase(
external_output_(
def->external_output().begin(),
def->external_output().end()),
name_(def->name()),
net_def_(def) {
name_(def->name()) {
// Go through the operators and make sure that blobs are correctly made.
std::set<string> known_blobs(
external_input_.begin(), external_input_.end());
Expand Down
5 changes: 0 additions & 5 deletions caffe2/core/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,11 @@ class NetBase {
return name_;
}

const NetDef& def() const {
return *net_def_;
}

protected:
vector<string> external_input_;
vector<string> external_output_;
string name_;
std::unique_ptr<NetObserver> observer_;
const std::shared_ptr<const NetDef> net_def_;

DISABLE_COPY_AND_ASSIGN(NetBase);
};
Expand Down

0 comments on commit c340c20

Please sign in to comment.