Skip to content

Commit

Permalink
"switch to shared_ptr"
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhwinter committed Jul 11, 2017
1 parent 18e65b0 commit b871641
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion paddle/framework/net.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void PlainNet::InferShape(Scope* scope) {
}
}

void PlainNet::Run(Scope* scope, DeviceContext* ctx) {
void PlainNet::Run(std::shared_ptr<Scope> scope, DeviceContext* ctx) {
for (auto& op : ops_) {
op.Run(ctx);
}
Expand Down
4 changes: 2 additions & 2 deletions paddle/framework/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Net {
* environment for ops. `begin` and `end` specify the scope of `ops_` to run,
* If no positive indexes are provided, all operators in `ops_` will run.
*/
virtual void Run(Scope *scope, DeviceContext *ctx) = 0;
virtual void Run(std::shared_ptr<Scope> scope, DeviceContext *ctx) = 0;

/**
* @brief Add an Operator according to `def`.
Expand Down Expand Up @@ -123,7 +123,7 @@ class PlainNet : public Net {
* scope will be used instead. If no OpContext is provicded, default context
* will be used.
*/
virtual void Run(Scope *scope, DeviceContext *ctx) override;
virtual void Run(std::shared_ptr<Scope> scope, DeviceContext *ctx) override;

/**
* @brief Add an operator to this network.
Expand Down

0 comments on commit b871641

Please sign in to comment.