diff --git a/paddle/framework/net.cc b/paddle/framework/net.cc index 8c565c28cb986a5e440384439c03cc0a88bf1a1a..20c0aef049ceb6f0617904eb757a904f83ee4260 100644 --- a/paddle/framework/net.cc +++ b/paddle/framework/net.cc @@ -11,10 +11,7 @@ void PlainNet::InferShape(Scope* scope) { } } -void PlainNet::Run(Scope* scope, OpContext* context, OpIndex begin, - OpIndex end) const { - // TODO Add implementation here. -} +void PlainNet::Run(Scope* scope) const {} } // namespace framework } // namespace paddle diff --git a/paddle/framework/net.h b/paddle/framework/net.h index 2025bfa4b236602ae580ef6bc75c80f837e22923..ef5013349196a50f9950469f8495c6b3e166a049 100644 --- a/paddle/framework/net.h +++ b/paddle/framework/net.h @@ -69,8 +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, OpContext *context, OpIndex begin = -1, - OpIndex end = -1) const = 0; + virtual void Run(Scope *scope) const = 0; /** * @brief Add an Operator according to `def`. @@ -124,8 +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 = nullptr, OpContext *context = nullptr, - OpIndex begin = -1, OpIndex end = -1) const override; + virtual void Run(Scope *scope) const override; /** * @brief Add an operator to this network. diff --git a/paddle/framework/net_proto.proto b/paddle/framework/net_proto.proto index 2d042457e33065514f987f1157cb96de5f6cd5de..0779f49fe2a9a6d0d1ea5ec11ba3befeb0a67fa1 100644 --- a/paddle/framework/net_proto.proto +++ b/paddle/framework/net_proto.proto @@ -9,7 +9,7 @@ message NetDesc { // operator contains in network repeated OpProto operators = 2; // network type to run with. e.g "plainNet", "DAG" - optional string type = 3; + optional string net_type = 3; // num worker always optional int32 num_workers = 4; } diff --git a/paddle/framework/net_test.cc b/paddle/framework/net_test.cc new file mode 100644 index 0000000000000000000000000000000000000000..04f5efdf79bdcf724accc20a7b6365b003d61ff4 --- /dev/null +++ b/paddle/framework/net_test.cc @@ -0,0 +1,24 @@ +/* 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 + +namespace paddle { +namespace framework { +class FakeFC : public OpBase {} +} // namespace framework +} // namespace paddle diff --git a/paddle/framework/op_registry_test.cc b/paddle/framework/op_registry_test.cc index 17849ca0191db644884e766342b30461abf50298..ae6b7387129c6f82d0c63270d5368da65abd3b51 100644 --- a/paddle/framework/op_registry_test.cc +++ b/paddle/framework/op_registry_test.cc @@ -119,4 +119,4 @@ TEST(OpRegistry, CustomChecker) { for (size_t i = 0; i < debug_str.length(); ++i) { ASSERT_EQ(debug_str[i], str[i]); } -} \ No newline at end of file +}