From b871641a5315b10bfb1d0776e288dd25ef2969d2 Mon Sep 17 00:00:00 2001 From: dongzhihong Date: Tue, 11 Jul 2017 10:53:48 +0800 Subject: [PATCH] "switch to shared_ptr" --- paddle/framework/net.cc | 2 +- paddle/framework/net.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/framework/net.cc b/paddle/framework/net.cc index f0c128d554b..73b3051235e 100644 --- a/paddle/framework/net.cc +++ b/paddle/framework/net.cc @@ -11,7 +11,7 @@ void PlainNet::InferShape(Scope* scope) { } } -void PlainNet::Run(Scope* scope, DeviceContext* ctx) { +void PlainNet::Run(std::shared_ptr scope, DeviceContext* ctx) { for (auto& op : ops_) { op.Run(ctx); } diff --git a/paddle/framework/net.h b/paddle/framework/net.h index b2894320daf..76992e07282 100644 --- a/paddle/framework/net.h +++ b/paddle/framework/net.h @@ -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, DeviceContext *ctx) = 0; /** * @brief Add an Operator according to `def`. @@ -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, DeviceContext *ctx) override; /** * @brief Add an operator to this network. -- GitLab