Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
200e3e2c
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看板
提交
200e3e2c
编写于
8月 09, 2017
作者:
D
dongzhihong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
"change namespace prefix"
上级
a0e195a1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
4 deletion
+4
-4
paddle/operators/rowwise_add_op.cc
paddle/operators/rowwise_add_op.cc
+3
-3
paddle/operators/rowwise_add_op.h
paddle/operators/rowwise_add_op.h
+1
-1
未找到文件。
paddle/operators/rowwise_add_op.cc
浏览文件 @
200e3e2c
...
@@ -35,7 +35,7 @@ class RowwiseAddOp : public framework::OperatorWithKernel {
...
@@ -35,7 +35,7 @@ class RowwiseAddOp : public framework::OperatorWithKernel {
class
RowwiseAddOpMaker
:
public
framework
::
OpProtoAndCheckerMaker
{
class
RowwiseAddOpMaker
:
public
framework
::
OpProtoAndCheckerMaker
{
public:
public:
Row
W
iseAddOpMaker
(
framework
::
OpProto
*
proto
,
Row
w
iseAddOpMaker
(
framework
::
OpProto
*
proto
,
framework
::
OpAttrChecker
*
op_checker
)
framework
::
OpAttrChecker
*
op_checker
)
:
OpProtoAndCheckerMaker
(
proto
,
op_checker
)
{
:
OpProtoAndCheckerMaker
(
proto
,
op_checker
)
{
AddInput
(
"X"
,
"The left input of row-wise add op, must be matrix"
);
AddInput
(
"X"
,
"The left input of row-wise add op, must be matrix"
);
...
@@ -48,9 +48,9 @@ for i in xrange(X.shape[0]):
...
@@ -48,9 +48,9 @@ for i in xrange(X.shape[0]):
)DOC"
);
)DOC"
);
}
}
};
};
class
RowwiseAddGradOp
:
public
OperatorWithKernel
{
class
RowwiseAddGradOp
:
public
framework
::
OperatorWithKernel
{
protected:
protected:
void
InferShape
(
const
InferShapeContext
&
ctx
)
const
override
{
void
InferShape
(
const
framework
::
InferShapeContext
&
ctx
)
const
override
{
PADDLE_ENFORCE
(
ctx
.
InputSize
()
==
4UL
,
PADDLE_ENFORCE
(
ctx
.
InputSize
()
==
4UL
,
"RowwiseAddGrad inputs is I, O, OG, size must be 4"
);
"RowwiseAddGrad inputs is I, O, OG, size must be 4"
);
PADDLE_ENFORCE
(
ctx
.
OutputSize
()
==
2
,
PADDLE_ENFORCE
(
ctx
.
OutputSize
()
==
2
,
...
...
paddle/operators/rowwise_add_op.h
浏览文件 @
200e3e2c
...
@@ -28,7 +28,7 @@ template <typename T, int MajorType = Eigen::RowMajor,
...
@@ -28,7 +28,7 @@ template <typename T, int MajorType = Eigen::RowMajor,
using
EigenMatrix
=
framework
::
EigenMatrix
<
T
,
MajorType
,
IndexType
>
;
using
EigenMatrix
=
framework
::
EigenMatrix
<
T
,
MajorType
,
IndexType
>
;
template
<
typename
Place
,
typename
T
>
template
<
typename
Place
,
typename
T
>
class
RowwiseAddKernel
:
public
OpKernel
{
class
RowwiseAddKernel
:
public
framework
::
OpKernel
{
public:
public:
void
Compute
(
const
framework
::
ExecutionContext
&
context
)
const
override
{
void
Compute
(
const
framework
::
ExecutionContext
&
context
)
const
override
{
auto
out
=
context
.
Output
<
Tensor
>
(
0
);
auto
out
=
context
.
Output
<
Tensor
>
(
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录