Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
9ecc54a1
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9ecc54a1
编写于
1月 24, 2018
作者:
Y
Yibing Liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove redundant code in unit test
上级
76beff86
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
53 deletion
+11
-53
paddle/operators/lstmp_op.cc
paddle/operators/lstmp_op.cc
+1
-1
paddle/operators/lstmp_op.h
paddle/operators/lstmp_op.h
+1
-1
python/paddle/v2/fluid/tests/test_lstmp_op.py
python/paddle/v2/fluid/tests/test_lstmp_op.py
+9
-51
未找到文件。
paddle/operators/lstmp_op.cc
浏览文件 @
9ecc54a1
...
@@ -4,7 +4,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
...
@@ -4,7 +4,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS,
...
...
paddle/operators/lstmp_op.h
浏览文件 @
9ecc54a1
...
@@ -4,7 +4,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
...
@@ -4,7 +4,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS IS" BASIS,
...
...
python/paddle/v2/fluid/tests/test_lstmp_op.py
浏览文件 @
9ecc54a1
...
@@ -131,7 +131,10 @@ def lstmp(
...
@@ -131,7 +131,10 @@ def lstmp(
class
TestLstmpOp
(
OpTest
):
class
TestLstmpOp
(
OpTest
):
def
set_argument
(
self
):
def
reset_argument
(
self
):
pass
def
setUp
(
self
):
self
.
lod
=
[[
0
,
2
,
5
,
7
]]
self
.
lod
=
[[
0
,
2
,
5
,
7
]]
# hidden size
# hidden size
self
.
D
=
16
self
.
D
=
16
...
@@ -147,8 +150,7 @@ class TestLstmpOp(OpTest):
...
@@ -147,8 +150,7 @@ class TestLstmpOp(OpTest):
self
.
is_reverse
=
False
self
.
is_reverse
=
False
self
.
use_peepholes
=
True
self
.
use_peepholes
=
True
def
setUp
(
self
):
self
.
reset_argument
()
self
.
set_argument
()
self
.
op_type
=
'lstmp'
self
.
op_type
=
'lstmp'
T
=
self
.
lod
[
0
][
-
1
]
T
=
self
.
lod
[
0
][
-
1
]
...
@@ -212,19 +214,8 @@ class TestLstmpOp(OpTest):
...
@@ -212,19 +214,8 @@ class TestLstmpOp(OpTest):
class
TestLstmpOpHasInitial
(
TestLstmpOp
):
class
TestLstmpOpHasInitial
(
TestLstmpOp
):
def
set_argument
(
self
):
def
reset_argument
(
self
):
self
.
lod
=
[[
0
,
2
,
5
,
7
]]
self
.
D
=
16
self
.
P
=
5
self
.
act_gate
=
'sigmoid'
self
.
act_cell
=
'tanh'
self
.
act_cand
=
'tanh'
self
.
act_proj
=
self
.
act_cell
self
.
has_initial_state
=
True
self
.
has_initial_state
=
True
self
.
is_reverse
=
True
self
.
use_peepholes
=
True
def
test_check_grad
(
self
):
def
test_check_grad
(
self
):
# TODO(qingqing) remove folowing lines after the check_grad is refined.
# TODO(qingqing) remove folowing lines after the check_grad is refined.
...
@@ -313,52 +304,19 @@ class TestLstmpOpHasInitial(TestLstmpOp):
...
@@ -313,52 +304,19 @@ class TestLstmpOpHasInitial(TestLstmpOp):
class
TestLstmpOpRerverse
(
TestLstmpOp
):
class
TestLstmpOpRerverse
(
TestLstmpOp
):
def
set_argument
(
self
):
def
reset_argument
(
self
):
self
.
lod
=
[[
0
,
2
,
5
,
7
]]
self
.
D
=
16
self
.
P
=
10
self
.
act_gate
=
'sigmoid'
self
.
act_cell
=
'tanh'
self
.
act_cand
=
'tanh'
self
.
act_proj
=
self
.
act_cell
self
.
has_initial_state
=
False
self
.
is_reverse
=
True
self
.
is_reverse
=
True
self
.
use_peepholes
=
True
class
TestLstmpOpNotUsePeepholes
(
TestLstmpOp
):
class
TestLstmpOpNotUsePeepholes
(
TestLstmpOp
):
def
set_argument
(
self
):
def
reset_argument
(
self
):
self
.
lod
=
[[
0
,
2
,
5
,
7
]]
self
.
D
=
16
self
.
P
=
10
self
.
act_gate
=
'sigmoid'
self
.
act_cell
=
'tanh'
self
.
act_cand
=
'tanh'
self
.
act_proj
=
self
.
act_cell
self
.
has_initial_state
=
False
self
.
is_reverse
=
False
self
.
use_peepholes
=
False
self
.
use_peepholes
=
False
class
TestLstmpOpLinearProjection
(
TestLstmpOp
):
class
TestLstmpOpLinearProjection
(
TestLstmpOp
):
def
set_argument
(
self
):
def
reset_argument
(
self
):
self
.
lod
=
[[
0
,
2
,
5
,
7
]]
self
.
D
=
16
self
.
P
=
10
self
.
act_gate
=
'sigmoid'
self
.
act_cell
=
'tanh'
self
.
act_cand
=
'tanh'
self
.
act_proj
=
'identity'
self
.
act_proj
=
'identity'
self
.
has_initial_state
=
False
self
.
is_reverse
=
False
self
.
use_peepholes
=
True
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录