diff --git a/paddle/framework/CMakeLists.txt b/paddle/framework/CMakeLists.txt index 74937b2b710412ad3e4c45b5147474220cd9f771..d018ee50c0de446d81191384b2c5f74714554dc4 100644 --- a/paddle/framework/CMakeLists.txt +++ b/paddle/framework/CMakeLists.txt @@ -29,4 +29,4 @@ add_dependencies(framework_py_proto framework_py_proto_init) proto_library(net_proto SRCS net_proto.proto DEPS op_proto) # cc_library(net SRCS net.cc DEPS operator net_proto op_registry fc_op) cc_library(net SRCS net.cc DEPS operator net_proto op_registry) -cc_test(net_op_test SRCS net_op_test.cc DEPS net) +cc_test(net_op_test SRCS net_op_test.cc DEPS net my_fc_op) diff --git a/paddle/framework/net.cc b/paddle/framework/net.cc index 2abc5d341769a7f9c3acc570b8c5e01c37f1454c..bb02dcbcee03e29892a8c10c8127ca120e2eecc1 100644 --- a/paddle/framework/net.cc +++ b/paddle/framework/net.cc @@ -21,10 +21,9 @@ namespace paddle { namespace framework { std::shared_ptr AddBackwardOp(std::shared_ptr ForwardOps) { - // NetPtr->reset(new PlainNet); - // NetPtr grad_ops = new PlainNet; - std::shared_ptr grad_ops; - grad_ops.reset(new PlainNet); + auto grad_ops = std::make_shared(); + // std::shared_ptr grad_ops; + // grad_ops.reset(new PlainNet); for (auto& op : ForwardOps->ops_) { auto op_grad = OpRegistry::CreateGradOp(op); grad_ops->AddOp(op_grad);