Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
a7f3450d
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a7f3450d
编写于
4月 17, 2019
作者:
G
Guo Sheng
提交者:
guosheng
4月 17, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cherry-pick #16898 and #16902.
test=Release/1.4
上级
392d737a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
6 deletion
+11
-6
paddle/fluid/operators/gru_op.cc
paddle/fluid/operators/gru_op.cc
+5
-2
paddle/fluid/operators/lstm_unit_op.cc
paddle/fluid/operators/lstm_unit_op.cc
+6
-4
未找到文件。
paddle/fluid/operators/gru_op.cc
浏览文件 @
a7f3450d
...
@@ -47,8 +47,11 @@ class GRUOp : public framework::OperatorWithKernel {
...
@@ -47,8 +47,11 @@ class GRUOp : public framework::OperatorWithKernel {
auto
weight_dims
=
ctx
->
GetInputDim
(
"Weight"
);
auto
weight_dims
=
ctx
->
GetInputDim
(
"Weight"
);
int
input_size
=
input_dims
[
1
];
int
input_size
=
input_dims
[
1
];
int
frame_size
=
weight_dims
[
0
];
int
frame_size
=
weight_dims
[
0
];
PADDLE_ENFORCE_EQ
(
input_size
,
frame_size
*
3
,
if
(
ctx
->
IsRuntime
())
{
"The input_size must be 3 times of frame_size in GRUOp."
);
PADDLE_ENFORCE_EQ
(
input_size
,
frame_size
*
3
,
"The input_size must be 3 times of frame_size in GRUOp."
);
}
PADDLE_ENFORCE_EQ
(
PADDLE_ENFORCE_EQ
(
weight_dims
[
1
],
frame_size
*
3
,
weight_dims
[
1
],
frame_size
*
3
,
"The shape of Weight matrix must be [frame_size, frame_size * 3]."
);
"The shape of Weight matrix must be [frame_size, frame_size * 3]."
);
...
...
paddle/fluid/operators/lstm_unit_op.cc
浏览文件 @
a7f3450d
...
@@ -34,10 +34,12 @@ class LstmUnitOp : public framework::OperatorWithKernel {
...
@@ -34,10 +34,12 @@ class LstmUnitOp : public framework::OperatorWithKernel {
auto
c_prev_dims
=
ctx
->
GetInputDim
(
"C_prev"
);
auto
c_prev_dims
=
ctx
->
GetInputDim
(
"C_prev"
);
PADDLE_ENFORCE_EQ
(
x_dims
.
size
(),
2
,
"Input(X)'s rank must be 2."
);
PADDLE_ENFORCE_EQ
(
x_dims
.
size
(),
2
,
"Input(X)'s rank must be 2."
);
PADDLE_ENFORCE_EQ
(
x_dims
[
0
],
c_prev_dims
[
0
],
if
(
ctx
->
IsRuntime
())
{
"Batch size of inputs and states must be equal"
);
PADDLE_ENFORCE_EQ
(
x_dims
[
0
],
c_prev_dims
[
0
],
PADDLE_ENFORCE_EQ
(
x_dims
[
1
],
c_prev_dims
[
1
]
*
4
,
"Batch size of inputs and states must be equal"
);
"Dimension of FC should equal to prev state * 4"
);
PADDLE_ENFORCE_EQ
(
x_dims
[
1
],
c_prev_dims
[
1
]
*
4
,
"Dimension of FC should equal to prev state * 4"
);
}
int
b_size
=
c_prev_dims
[
0
];
// batch size
int
b_size
=
c_prev_dims
[
0
];
// batch size
int
s_dim
=
c_prev_dims
[
1
];
// state dim
int
s_dim
=
c_prev_dims
[
1
];
// state dim
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录