Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
791a6c84
提交
791a6c84
authored
6月 29, 2015
作者:
Thomas Mesnard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pep8 space fix
上级
f2e452a6
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
20 行增加
和
19 行删除
+20
-19
test_function_module.py
theano/compile/tests/test_function_module.py
+1
-1
test_scan.py
theano/sandbox/scan_module/tests/test_scan.py
+2
-2
test_scan.py
theano/scan_module/tests/test_scan.py
+3
-3
test_opt.py
theano/tensor/tests/test_opt.py
+13
-12
test_rop.py
theano/tests/test_rop.py
+1
-1
没有找到文件。
theano/compile/tests/test_function_module.py
浏览文件 @
791a6c84
...
@@ -40,7 +40,7 @@ class T_function(unittest.TestCase):
...
@@ -40,7 +40,7 @@ class T_function(unittest.TestCase):
fn
=
function
([],
None
)
# ok
fn
=
function
([],
None
)
# ok
rval
=
fn
()
rval
=
fn
()
if
rval
==
[]:
if
rval
==
[]:
raise
SkipTest
(
"See #254: Using None as function output leads"
raise
SkipTest
(
"See #254: Using None as function output leads
"
"to [] return value"
)
"to [] return value"
)
else
:
else
:
assert
rval
is
None
assert
rval
is
None
...
...
theano/sandbox/scan_module/tests/test_scan.py
浏览文件 @
791a6c84
...
@@ -472,7 +472,7 @@ class TestScan(unittest.TestCase):
...
@@ -472,7 +472,7 @@ class TestScan(unittest.TestCase):
# soon, and it is in the sandbox and not for user consumption, the
# soon, and it is in the sandbox and not for user consumption, the
# error is marked as KnownFailure
# error is marked as KnownFailure
raise
SkipTest
(
"Work-in-progress sandbox ScanOp is"
raise
SkipTest
(
"Work-in-progress sandbox ScanOp is
"
"not fully functional yet"
)
"not fully functional yet"
)
def
f_pow2
(
x_tm1
):
def
f_pow2
(
x_tm1
):
...
@@ -509,7 +509,7 @@ class TestScan(unittest.TestCase):
...
@@ -509,7 +509,7 @@ class TestScan(unittest.TestCase):
# place (even when told not to by DebugMode). As this op will change
# place (even when told not to by DebugMode). As this op will change
# soon, and it is in the sandbox and not for user consumption, the
# soon, and it is in the sandbox and not for user consumption, the
# error is marked as KnownFailure
# error is marked as KnownFailure
raise
SkipTest
(
"Work-in-progress sandbox"
raise
SkipTest
(
"Work-in-progress sandbox
"
"ScanOp is not fully functional yet"
)
"ScanOp is not fully functional yet"
)
def
f_rnn
(
u_t
,
x_tm1
,
W_in
,
W
):
def
f_rnn
(
u_t
,
x_tm1
,
W_in
,
W
):
...
...
theano/scan_module/tests/test_scan.py
浏览文件 @
791a6c84
...
@@ -3271,7 +3271,7 @@ class T_Scan(unittest.TestCase):
...
@@ -3271,7 +3271,7 @@ class T_Scan(unittest.TestCase):
if
isinstance
(
x
.
op
,
theano
.
tensor
.
Elemwise
)])
==
0
if
isinstance
(
x
.
op
,
theano
.
tensor
.
Elemwise
)])
==
0
def
test_alloc_inputs2
(
self
):
def
test_alloc_inputs2
(
self
):
raise
SkipTest
(
"This tests depends on an optimization for"
raise
SkipTest
(
"This tests depends on an optimization for
"
"scan that has not been implemented yet."
)
"scan that has not been implemented yet."
)
W1
=
tensor
.
matrix
()
W1
=
tensor
.
matrix
()
W2
=
tensor
.
matrix
()
W2
=
tensor
.
matrix
()
...
@@ -3499,8 +3499,8 @@ class T_Scan(unittest.TestCase):
...
@@ -3499,8 +3499,8 @@ class T_Scan(unittest.TestCase):
assert
out
==
24
assert
out
==
24
def
test_infershape_seq_shorter_nsteps
(
self
):
def
test_infershape_seq_shorter_nsteps
(
self
):
raise
SkipTest
(
"This is a generic problem with"
raise
SkipTest
(
"This is a generic problem with
"
"infershape that has to be discussed"
"infershape that has to be discussed
"
"and figured out"
)
"and figured out"
)
x
=
tensor
.
vector
(
'x'
)
x
=
tensor
.
vector
(
'x'
)
[
o1
,
o2
],
_
=
theano
.
scan
(
lambda
x
,
y
:
(
x
+
1
,
y
+
x
),
[
o1
,
o2
],
_
=
theano
.
scan
(
lambda
x
,
y
:
(
x
+
1
,
y
+
x
),
...
...
theano/tensor/tests/test_opt.py
浏览文件 @
791a6c84
...
@@ -1558,7 +1558,7 @@ def test_log_add():
...
@@ -1558,7 +1558,7 @@ def test_log_add():
f
([
10000
],
[
10000
])
# causes overflow if handled incorrectly
f
([
10000
],
[
10000
])
# causes overflow if handled incorrectly
assert
numpy
.
allclose
(
f
([
10000
],
[
10000
]),
20000
)
assert
numpy
.
allclose
(
f
([
10000
],
[
10000
]),
20000
)
except
AssertionError
:
except
AssertionError
:
raise
SkipTest
(
"log(add(exp)) is not stabilized when adding"
raise
SkipTest
(
"log(add(exp)) is not stabilized when adding
"
"more than 2 elements, see #623"
)
"more than 2 elements, see #623"
)
# TODO: test that the optimization works in the presence of broadcasting.
# TODO: test that the optimization works in the presence of broadcasting.
...
@@ -4025,8 +4025,8 @@ def test_constant_get_stabilized():
...
@@ -4025,8 +4025,8 @@ def test_constant_get_stabilized():
assert
f
()
==
800
,
f
()
assert
f
()
==
800
,
f
()
except
(
AssertionError
,
theano
.
compile
.
debugmode
.
InvalidValueError
):
except
(
AssertionError
,
theano
.
compile
.
debugmode
.
InvalidValueError
):
raise
SkipTest
(
'Theano optimizes constant before stabilization.'
raise
SkipTest
(
'Theano optimizes constant before stabilization.
'
'This breaks stabilization optimization in some'
'This breaks stabilization optimization in some
'
'cases. See #504.'
)
'cases. See #504.'
)
...
@@ -4284,10 +4284,10 @@ class T_local_erfc(unittest.TestCase):
...
@@ -4284,10 +4284,10 @@ class T_local_erfc(unittest.TestCase):
0
]
.
op
.
scalar_op
.
fgraph
.
apply_nodes
)
==
22
,
len
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
fgraph
.
toposort
()[
0
]
.
op
.
scalar_op
.
fgraph
.
apply_nodes
)
0
]
.
op
.
scalar_op
.
fgraph
.
apply_nodes
)
==
22
,
len
(
f
.
maker
.
fgraph
.
toposort
()[
0
]
.
fgraph
.
toposort
()[
0
]
.
op
.
scalar_op
.
fgraph
.
apply_nodes
)
# TODO: fix this problem
# TODO: fix this problem
if
theano
.
config
.
floatX
==
"float32"
and
theano
.
config
.
mode
in
[
"DebugMode"
,
"DEBUG_MODE"
]:
if
theano
.
config
.
floatX
==
"float32"
and
theano
.
config
.
mode
in
[
"DebugMode"
,
"DEBUG_MODE"
]:
raise
SkipTest
(
'The python code upcast somewhere internally'
raise
SkipTest
(
'The python code upcast somewhere internally
'
'some value of float32 to python float for'
'some value of float32 to python float for
'
'part of its computation. That make that the'
'part of its computation. That make that the
'
'c and python code dont generate the same value.'
'c and python code dont generate the same value.
'
'You can ignore this error.'
)
'You can ignore this error.'
)
assert
all
(
numpy
.
isfinite
(
f
(
val
)))
assert
all
(
numpy
.
isfinite
(
f
(
val
)))
...
@@ -4356,12 +4356,13 @@ class T_local_erfc(unittest.TestCase):
...
@@ -4356,12 +4356,13 @@ class T_local_erfc(unittest.TestCase):
# TODO: fix this problem
# TODO: fix this problem
if
theano
.
config
.
floatX
==
"float32"
and
theano
.
config
.
mode
in
[
"DebugMode"
,
"DEBUG_MODE"
]:
if
theano
.
config
.
floatX
==
"float32"
and
theano
.
config
.
mode
in
[
"DebugMode"
,
"DEBUG_MODE"
]:
# The python code upcast somewhere internally some value of float32
# to python float for part of its computation. That make that the c
# and python code do not generate the same value. You can ignore
# this error. This happen in an intermediate step that don't show
# in the final result.
# Showing this test error is a duplicate of the one in test_local_log_erfc. We hide it.
# Showing this test error is a duplicate of the one in test_local_log_erfc. We hide it.
# raise KnownFailureTest("the python code upcast somewhere internally some value of
# float32 to python float for part of its computation.
# That make that the c and python code do not generate the same value.
# You can ignore this error.
# This happen in an intermediate step that don't show in the final result.")
pass
pass
else
:
else
:
assert
all
(
numpy
.
isfinite
(
f
(
val
)))
assert
all
(
numpy
.
isfinite
(
f
(
val
)))
...
...
theano/tests/test_rop.py
浏览文件 @
791a6c84
...
@@ -190,7 +190,7 @@ class RopLop_checker(unittest.TestCase):
...
@@ -190,7 +190,7 @@ class RopLop_checker(unittest.TestCase):
assert
numpy
.
allclose
(
v1
,
v2
),
(
'LOP mismatch:
%
s
%
s'
%
(
v1
,
v2
))
assert
numpy
.
allclose
(
v1
,
v2
),
(
'LOP mismatch:
%
s
%
s'
%
(
v1
,
v2
))
if
known_fail
:
if
known_fail
:
raise
SkipTest
(
'Rop does not handle non-differentiable inputs'
raise
SkipTest
(
'Rop does not handle non-differentiable inputs
'
'correctly. Bug exposed by fixing Add.grad method.'
)
'correctly. Bug exposed by fixing Add.grad method.'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论