Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
9e91983b
提交
9e91983b
authored
12月 01, 2011
作者:
nouiz
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #251 from pascanur/some_fixes_tests_scan
Some fixes tests scan
上级
730ddb7d
aaed5273
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
49 行增加
和
6 行删除
+49
-6
test_scan.py
theano/scan_module/tests/test_scan.py
+38
-6
test_conv.py
theano/tensor/signal/tests/test_conv.py
+11
-0
没有找到文件。
theano/scan_module/tests/test_scan.py
浏览文件 @
9e91983b
...
@@ -2018,12 +2018,6 @@ class T_Scan(unittest.TestCase):
...
@@ -2018,12 +2018,6 @@ class T_Scan(unittest.TestCase):
if
theano
.
config
.
mode
!=
'FAST_COMPILE'
:
if
theano
.
config
.
mode
!=
'FAST_COMPILE'
:
self
.
assertTrue
(
nb_shape_i
==
1
)
self
.
assertTrue
(
nb_shape_i
==
1
)
def
test_bug_josh_reported
(
self
):
import
theano.tensor.signal.conv
m1
=
theano
.
tensor
.
matrix
()
m2
=
theano
.
tensor
.
matrix
()
conv
=
theano
.
tensor
.
signal
.
conv
.
conv2d
(
m1
,
m2
)
def
test_merge
(
self
):
def
test_merge
(
self
):
x
=
theano
.
tensor
.
vector
()
x
=
theano
.
tensor
.
vector
()
y
=
theano
.
tensor
.
vector
()
y
=
theano
.
tensor
.
vector
()
...
@@ -2525,6 +2519,44 @@ class T_Scan(unittest.TestCase):
...
@@ -2525,6 +2519,44 @@ class T_Scan(unittest.TestCase):
out
=
f
(
vx
)
out
=
f
(
vx
)
assert
out
==
24
assert
out
==
24
def
test_infershape_seq_shorter_nsteps
(
self
):
raise
KnownFailureTest
(
'This is a generic problem with infershape'
' that has to be discussed and figured out'
)
x
=
tensor
.
vector
(
'x'
)
[
o1
,
o2
],
_
=
theano
.
scan
(
lambda
x
,
y
:
(
x
+
1
,
y
+
x
),
sequences
=
x
,
outputs_info
=
[
None
,
x
[
0
]],
n_steps
=
20
)
f
=
theano
.
function
([
x
],
[
o1
.
shape
[
0
],
o2
.
shape
[
0
]],
mode
=
mode_with_opt
)
vx
=
numpy
.
ones
((
10
,),
dtype
=
theano
.
config
.
floatX
)
out1
,
out2
=
f
(
vx
)
assert
out1
==
10
assert
out2
==
10
lssc
=
[
x
for
x
in
f
.
maker
.
env
.
toposort
()
if
isinstance
(
x
.
op
,
theano
.
scan_module
.
scan_op
.
Scan
)]
assert
len
(
lssc
)
==
0
def
test_infershape_nsteps_smaller_seq_length
(
self
):
x
=
tensor
.
vector
(
'x'
)
[
o1
,
o2
],
_
=
theano
.
scan
(
lambda
x
,
y
:
(
x
+
1
,
y
+
x
),
sequences
=
x
,
outputs_info
=
[
None
,
x
[
0
]],
n_steps
=
20
)
f
=
theano
.
function
([
x
],
[
o1
.
shape
[
0
],
o2
.
shape
[
0
]],
mode
=
mode_with_opt
)
vx
=
numpy
.
ones
((
30
,),
dtype
=
theano
.
config
.
floatX
)
o1
,
o2
=
f
(
vx
)
assert
o1
==
20
assert
o2
==
20
lssc
=
[
x
for
x
in
f
.
maker
.
env
.
toposort
()
if
isinstance
(
x
.
op
,
theano
.
scan_module
.
scan_op
.
Scan
)]
assert
len
(
lssc
)
==
0
def
test_grad_multiple_seqs_different_nsteps
(
self
):
def
test_grad_multiple_seqs_different_nsteps
(
self
):
# Example provided Michael Forbes
# Example provided Michael Forbes
# This test assures that we clip the sequences to n_steps before
# This test assures that we clip the sequences to n_steps before
...
...
theano/tensor/signal/tests/test_conv.py
浏览文件 @
9e91983b
...
@@ -97,3 +97,14 @@ class TestSignalConv2D(unittest.TestCase):
...
@@ -97,3 +97,14 @@ class TestSignalConv2D(unittest.TestCase):
self
.
fail
()
self
.
fail
()
except
:
except
:
pass
pass
def
test_bug_josh_reported
(
self
):
"""
Test refers to a bug reported by Josh, when due to a bad merge these
few lines of code failed. See
http://groups.google.com/group/theano-dev/browse_thread/thread/8856e7ca5035eecb
"""
m1
=
theano
.
tensor
.
matrix
()
m2
=
theano
.
tensor
.
matrix
()
rval
=
conv
.
conv2d
(
m1
,
m2
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论