提交 bc021d77 编写于 作者: D dongzhihong

"move opContext to DeviceContext"

上级 052d1d16
...@@ -11,10 +11,7 @@ void PlainNet::InferShape(Scope* scope) { ...@@ -11,10 +11,7 @@ void PlainNet::InferShape(Scope* scope) {
} }
} }
void PlainNet::Run(Scope* scope, OpContext* context, OpIndex begin, void PlainNet::Run(Scope* scope) const {}
OpIndex end) const {
// TODO Add implementation here.
}
} // namespace framework } // namespace framework
} // namespace paddle } // namespace paddle
...@@ -69,8 +69,7 @@ class Net { ...@@ -69,8 +69,7 @@ class Net {
* environment for ops. `begin` and `end` specify the scope of `ops_` to run, * 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. * If no positive indexes are provided, all operators in `ops_` will run.
*/ */
virtual void Run(Scope *scope, OpContext *context, OpIndex begin = -1, virtual void Run(Scope *scope) const = 0;
OpIndex end = -1) const = 0;
/** /**
* @brief Add an Operator according to `def`. * @brief Add an Operator according to `def`.
...@@ -124,8 +123,7 @@ class PlainNet : public Net { ...@@ -124,8 +123,7 @@ class PlainNet : public Net {
* scope will be used instead. If no OpContext is provicded, default context * scope will be used instead. If no OpContext is provicded, default context
* will be used. * will be used.
*/ */
virtual void Run(Scope *scope = nullptr, OpContext *context = nullptr, virtual void Run(Scope *scope) const override;
OpIndex begin = -1, OpIndex end = -1) const override;
/** /**
* @brief Add an operator to this network. * @brief Add an operator to this network.
......
...@@ -9,7 +9,7 @@ message NetDesc { ...@@ -9,7 +9,7 @@ message NetDesc {
// operator contains in network // operator contains in network
repeated OpProto operators = 2; repeated OpProto operators = 2;
// network type to run with. e.g "plainNet", "DAG" // network type to run with. e.g "plainNet", "DAG"
optional string type = 3; optional string net_type = 3;
// num worker always // num worker always
optional int32 num_workers = 4; optional int32 num_workers = 4;
} }
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/framework/net.h"
#include "paddle/framework/op_registry.h"
#include <gtest/gtest.h>
namespace paddle {
namespace framework {
class FakeFC : public OpBase {}
} // namespace framework
} // namespace paddle
...@@ -119,4 +119,4 @@ TEST(OpRegistry, CustomChecker) { ...@@ -119,4 +119,4 @@ TEST(OpRegistry, CustomChecker) {
for (size_t i = 0; i < debug_str.length(); ++i) { for (size_t i = 0; i < debug_str.length(); ++i) {
ASSERT_EQ(debug_str[i], str[i]); ASSERT_EQ(debug_str[i], str[i]);
} }
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册