Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
ae6009df
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ae6009df
编写于
7月 24, 2017
作者:
F
fengjiayi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix compile error
上级
197c82f3
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
7 addition
and
7 deletion
+7
-7
paddle/framework/CMakeLists.txt
paddle/framework/CMakeLists.txt
+3
-3
paddle/framework/grad_op_builder.cc
paddle/framework/grad_op_builder.cc
+1
-1
paddle/framework/grad_op_builder_test.cc
paddle/framework/grad_op_builder_test.cc
+2
-2
paddle/framework/op_registry.h
paddle/framework/op_registry.h
+1
-1
未找到文件。
paddle/framework/CMakeLists.txt
浏览文件 @
ae6009df
...
@@ -19,10 +19,10 @@ cc_test(op_desc_test SRCS op_desc_test.cc DEPS op_desc protobuf)
...
@@ -19,10 +19,10 @@ cc_test(op_desc_test SRCS op_desc_test.cc DEPS op_desc protobuf)
cc_library
(
operator SRCS operator.cc DEPS op_desc device_context tensor
)
cc_library
(
operator SRCS operator.cc DEPS op_desc device_context tensor
)
cc_test
(
operator_test SRCS operator_test.cc DEPS operator op_registry
)
cc_test
(
operator_test SRCS operator_test.cc DEPS operator op_registry
)
cc_library
(
grad_op_
creator SRCS grad_op_creato
r.cc DEPS op_proto operator
)
cc_library
(
grad_op_
builder SRCS grad_op_builde
r.cc DEPS op_proto operator
)
cc_library
(
op_registry SRCS op_registry.cc DEPS op_desc grad_op_
creato
r
)
cc_library
(
op_registry SRCS op_registry.cc DEPS op_desc grad_op_
builde
r
)
cc_test
(
op_registry_test SRCS op_registry_test.cc DEPS op_registry
)
cc_test
(
op_registry_test SRCS op_registry_test.cc DEPS op_registry
)
cc_test
(
grad_op_
creator_test SRCS grad_op_creator_test.cc DEPS grad_op_creato
r op_registry add_op
)
cc_test
(
grad_op_
builder_test SRCS grad_op_builder_test.cc DEPS grad_op_builde
r op_registry add_op
)
py_proto_compile
(
framework_py_proto SRCS attr_type.proto op_proto.proto op_desc.proto
)
py_proto_compile
(
framework_py_proto SRCS attr_type.proto op_proto.proto op_desc.proto
)
# Generate an empty __init__.py to make framework_py_proto as a valid python module.
# Generate an empty __init__.py to make framework_py_proto as a valid python module.
...
...
paddle/framework/grad_op_builder.cc
浏览文件 @
ae6009df
...
@@ -20,7 +20,7 @@ namespace framework {
...
@@ -20,7 +20,7 @@ namespace framework {
OperatorBase
*
GradOpBuilder
::
Build
()
{
OperatorBase
*
GradOpBuilder
::
Build
()
{
BuildOpInOutArgList
();
BuildOpInOutArgList
();
std
::
string
grad_op_type
=
OpRegistry
::
grad_ops
().
at
(
op
->
type_
);
std
::
string
grad_op_type
=
OpRegistry
::
grad_ops
().
at
(
op
_
->
type_
);
OperatorBase
*
grad_op
=
OpRegistry
::
op_creators
().
at
(
grad_op_type
)();
OperatorBase
*
grad_op
=
OpRegistry
::
op_creators
().
at
(
grad_op_type
)();
grad_op
->
type_
=
grad_op_type
;
grad_op
->
type_
=
grad_op_type
;
CompleteGradOp
(
grad_op
);
CompleteGradOp
(
grad_op
);
...
...
paddle/framework/grad_op_
creato
r_test.cc
→
paddle/framework/grad_op_
builde
r_test.cc
浏览文件 @
ae6009df
#include "paddle/framework/grad_op_
creato
r.h"
#include "paddle/framework/grad_op_
builde
r.h"
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include "paddle/framework/op_registry.h"
#include "paddle/framework/op_registry.h"
#include "paddle/framework/operator.h"
#include "paddle/framework/operator.h"
...
@@ -8,7 +8,7 @@ USE_OP(add_two);
...
@@ -8,7 +8,7 @@ USE_OP(add_two);
namespace
paddle
{
namespace
paddle
{
namespace
framework
{
namespace
framework
{
TEST
(
GradOp
Creato
r
,
AddTwo
)
{
TEST
(
GradOp
Builde
r
,
AddTwo
)
{
std
::
shared_ptr
<
OperatorBase
>
add_op
(
std
::
shared_ptr
<
OperatorBase
>
add_op
(
OpRegistry
::
CreateOp
(
"add_two"
,
{
"x"
,
"y"
},
{
"out"
},
{}));
OpRegistry
::
CreateOp
(
"add_two"
,
{
"x"
,
"y"
},
{
"out"
},
{}));
std
::
shared_ptr
<
OperatorBase
>
grad_add_op
=
OpRegistry
::
CreateGradOp
(
add_op
);
std
::
shared_ptr
<
OperatorBase
>
grad_add_op
=
OpRegistry
::
CreateGradOp
(
add_op
);
...
...
paddle/framework/op_registry.h
浏览文件 @
ae6009df
...
@@ -20,7 +20,7 @@ limitations under the License. */
...
@@ -20,7 +20,7 @@ limitations under the License. */
#include <unordered_map>
#include <unordered_map>
#include <unordered_set>
#include <unordered_set>
#include "paddle/framework/attr_checker.h"
#include "paddle/framework/attr_checker.h"
#include "paddle/framework/grad_op_
creato
r.h"
#include "paddle/framework/grad_op_
builde
r.h"
#include "paddle/framework/op_desc.pb.h"
#include "paddle/framework/op_desc.pb.h"
#include "paddle/framework/scope.h"
#include "paddle/framework/scope.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录