Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
83a8b1f4
提交
83a8b1f4
authored
7月 19, 2017
作者:
Reyhane Askari
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changed expectedFailure to assertFailure
上级
54713094
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
32 行增加
和
27 行删除
+32
-27
test_destroyhandler.py
theano/gof/tests/test_destroyhandler.py
+12
-12
test_dnn.py
theano/gpuarray/tests/test_dnn.py
+2
-2
test_linalg.py
theano/gpuarray/tests/test_linalg.py
+2
-2
test_opt.py
theano/gpuarray/tests/test_opt.py
+2
-2
test_scan.py
theano/scan_module/tests/test_scan.py
+3
-3
test_blas.py
theano/tensor/tests/test_blas.py
+2
-2
test_opt.py
theano/tensor/tests/test_opt.py
+2
-2
unittest_tools.py
theano/tests/unittest_tools.py
+7
-2
没有找到文件。
theano/gof/tests/test_destroyhandler.py
浏览文件 @
83a8b1f4
...
...
@@ -11,7 +11,7 @@ from theano.gof.opt import (OpKeyOptimizer, PatternSub, NavigatorOptimizer,
from
theano.gof
import
destroyhandler
from
theano.gof.fg
import
FunctionGraph
,
InconsistencyError
from
theano.gof.toolbox
import
ReplaceValidate
from
theano.tests.unittest_tools
import
expected
Failure_fast
from
theano.tests.unittest_tools
import
assert
Failure_fast
from
theano.configparser
import
change_flags
...
...
@@ -170,7 +170,7 @@ def test_misc():
######################
@
expected
Failure_fast
@
assert
Failure_fast
def
test_aliased_inputs_replacement
():
x
,
y
,
z
=
inputs
()
tv
=
transpose_view
(
x
)
...
...
@@ -202,7 +202,7 @@ def test_indestructible():
consistent
(
g
)
@
expected
Failure_fast
@
assert
Failure_fast
def
test_usage_loop_through_views_2
():
x
,
y
,
z
=
inputs
()
e0
=
transpose_view
(
transpose_view
(
sigmoid
(
x
)))
...
...
@@ -213,7 +213,7 @@ def test_usage_loop_through_views_2():
inconsistent
(
g
)
# we cut off the path to the sigmoid
@
expected
Failure_fast
@
assert
Failure_fast
def
test_destroyers_loop
():
# AddInPlace(x, y) and AddInPlace(y, x) should not coexist
x
,
y
,
z
=
inputs
()
...
...
@@ -263,7 +263,7 @@ def test_aliased_inputs2():
inconsistent
(
g
)
@
expected
Failure_fast
@
assert
Failure_fast
def
test_aliased_inputs_tolerate
():
x
,
y
,
z
=
inputs
()
e
=
add_in_place_2
(
x
,
x
)
...
...
@@ -278,7 +278,7 @@ def test_aliased_inputs_tolerate2():
inconsistent
(
g
)
@
expected
Failure_fast
@
assert
Failure_fast
def
test_same_aliased_inputs_ignored
():
x
,
y
,
z
=
inputs
()
e
=
add_in_place_3
(
x
,
x
)
...
...
@@ -286,7 +286,7 @@ def test_same_aliased_inputs_ignored():
consistent
(
g
)
@
expected
Failure_fast
@
assert
Failure_fast
def
test_different_aliased_inputs_ignored
():
x
,
y
,
z
=
inputs
()
e
=
add_in_place_3
(
x
,
transpose_view
(
x
))
...
...
@@ -321,7 +321,7 @@ def test_indirect():
inconsistent
(
g
)
@
expected
Failure_fast
@
assert
Failure_fast
def
test_indirect_2
():
x
,
y
,
z
=
inputs
()
e0
=
transpose_view
(
x
)
...
...
@@ -333,7 +333,7 @@ def test_indirect_2():
consistent
(
g
)
@
expected
Failure_fast
@
assert
Failure_fast
def
test_long_destroyers_loop
():
x
,
y
,
z
=
inputs
()
e
=
dot
(
dot
(
add_in_place
(
x
,
y
),
...
...
@@ -375,7 +375,7 @@ def test_multi_destroyers():
pass
@
expected
Failure_fast
@
assert
Failure_fast
def
test_multi_destroyers_through_views
():
x
,
y
,
z
=
inputs
()
e
=
dot
(
add
(
transpose_view
(
z
),
y
),
add
(
z
,
x
))
...
...
@@ -418,7 +418,7 @@ def test_usage_loop_through_views():
consistent
(
g
)
@
expected
Failure_fast
@
assert
Failure_fast
def
test_usage_loop_insert_views
():
x
,
y
,
z
=
inputs
()
e
=
dot
(
add_in_place
(
x
,
add
(
y
,
z
)),
...
...
@@ -453,7 +453,7 @@ def test_value_repl_2():
consistent
(
g
)
@
expected
Failure_fast
@
assert
Failure_fast
def
test_multiple_inplace
():
# this tests issue #5223
# there were some problems with Ops that have more than
...
...
theano/gpuarray/tests/test_dnn.py
浏览文件 @
83a8b1f4
...
...
@@ -1754,7 +1754,7 @@ def test_without_dnn_batchnorm_train_without_running_averages():
f_abstract
(
X
,
Scale
,
Bias
,
Dy
)
@utt.
expected
Failure_fast
@utt.
assert
Failure_fast
def
test_dnn_batchnorm_train_inplace
():
# test inplace_running_mean and inplace_running_var
if
not
dnn
.
dnn_available
(
test_ctx_name
):
...
...
@@ -1877,7 +1877,7 @@ def test_batchnorm_inference():
utt
.
assert_allclose
(
outputs_abstract
[
5
],
outputs_ref
[
5
],
rtol
=
2e-3
,
atol
=
4e-5
)
# dvar
@utt.
expected
Failure_fast
@utt.
assert
Failure_fast
def
test_batchnorm_inference_inplace
():
# test inplace
if
not
dnn
.
dnn_available
(
test_ctx_name
):
...
...
theano/gpuarray/tests/test_linalg.py
浏览文件 @
83a8b1f4
...
...
@@ -175,7 +175,7 @@ class TestGpuCholesky(unittest.TestCase):
GpuCholesky
(
lower
=
True
,
inplace
=
False
)(
A
)
self
.
assertRaises
(
AssertionError
,
invalid_input_func
)
@utt.
expected
Failure_fast
@utt.
assert
Failure_fast
def
test_diag_chol
(
self
):
# Diagonal matrix input Cholesky test.
for
lower
in
[
True
,
False
]:
...
...
@@ -184,7 +184,7 @@ class TestGpuCholesky(unittest.TestCase):
A_val
=
np
.
diag
(
np
.
random
.
uniform
(
size
=
5
)
.
astype
(
"float32"
)
+
1
)
self
.
compare_gpu_cholesky_to_np
(
A_val
,
lower
=
lower
,
inplace
=
inplace
)
@utt.
expected
Failure_fast
@utt.
assert
Failure_fast
def
test_dense_chol_lower
(
self
):
# Dense matrix input lower-triangular Cholesky test.
for
lower
in
[
True
,
False
]:
...
...
theano/gpuarray/tests/test_opt.py
浏览文件 @
83a8b1f4
...
...
@@ -582,7 +582,7 @@ def test_no_complex():
mode
=
mode_with_gpu
)
@utt.
expected
Failure_fast
@utt.
assert
Failure_fast
def
test_local_lift_solve
():
if
not
cusolver_available
:
raise
SkipTest
(
'No cuSolver'
)
...
...
@@ -617,7 +617,7 @@ def test_gpu_solve_not_inplace():
utt
.
assert_allclose
(
f_cpu
(
A_val
,
b_val
),
f_gpu
(
A_val
,
b_val
))
@utt.
expected
Failure_fast
@utt.
assert
Failure_fast
def
test_local_lift_cholesky
():
if
not
cusolver_available
:
raise
SkipTest
(
'No cuSolver'
)
...
...
theano/scan_module/tests/test_scan.py
浏览文件 @
83a8b1f4
...
...
@@ -886,7 +886,7 @@ class T_Scan(unittest.TestCase):
utt
.
assert_allclose
(
numpy_out
,
theano_out
)
# simple rnn ; compute inplace version 1
@utt.
expected
Failure_fast
@utt.
assert
Failure_fast
def
test_inplace1
(
self
):
rng
=
np
.
random
.
RandomState
(
utt
.
fetch_seed
())
vW
=
asarrayX
(
np
.
random
.
uniform
())
...
...
@@ -951,7 +951,7 @@ class T_Scan(unittest.TestCase):
utt
.
assert_allclose
(
theano_x1
,
numpy_x1
)
# simple rnn ; compute inplace version 2
@utt.
expected
Failure_fast
@utt.
assert
Failure_fast
def
test_inplace2
(
self
):
rng
=
np
.
random
.
RandomState
(
utt
.
fetch_seed
())
vW
=
asarrayX
(
np
.
random
.
uniform
())
...
...
@@ -1023,7 +1023,7 @@ class T_Scan(unittest.TestCase):
utt
.
assert_allclose
(
theano_x0
,
numpy_x0
)
utt
.
assert_allclose
(
theano_x1
,
numpy_x1
)
@utt.
expected
Failure_fast
@utt.
assert
Failure_fast
def
test_inplace3
(
self
):
rng
=
np
.
random
.
RandomState
(
utt
.
fetch_seed
())
...
...
theano/tensor/tests/test_blas.py
浏览文件 @
83a8b1f4
...
...
@@ -500,7 +500,7 @@ def just_gemm(i, o, ishapes=[(4, 3), (3, 5), (4, 5), (), ()],
raise
@unittest_tools.
expected
Failure_fast
@unittest_tools.
assert
Failure_fast
def
test_gemm_opt0
():
# Many subgraphs whose dots can be eliminated
X
,
Y
,
Z
,
a
,
b
=
XYZab
()
...
...
@@ -529,7 +529,7 @@ def test_gemm_opt0():
just_gemm
([
X
,
Y
,
Z
,
a
,
b
],
[
Z
-
a
*
b
*
a
*
T
.
dot
(
X
,
Y
)])
@unittest_tools.
expected
Failure_fast
@unittest_tools.
assert
Failure_fast
def
test_gemm_opt_double_gemm
():
# This is the pattern that shows up in the autoencoder
X
,
Y
,
Z
,
a
,
b
=
T
.
matrix
(),
T
.
matrix
(),
T
.
matrix
(),
T
.
scalar
(),
T
.
scalar
()
...
...
theano/tensor/tests/test_opt.py
浏览文件 @
83a8b1f4
...
...
@@ -1367,7 +1367,7 @@ class TestCompositeCodegen(unittest.TestCase):
utt
.
assert_allclose
(
f
([[
1.
]]),
[[
0.
]])
@utt.
expected
Failure_fast
@utt.
assert
Failure_fast
def
test_log1p
():
m
=
theano
.
config
.
mode
if
m
==
'FAST_COMPILE'
:
...
...
@@ -1990,7 +1990,7 @@ class test_local_subtensor_lift(unittest.TestCase):
assert
len
(
prog
)
==
3
f
([
4
,
5
])
# let debugmode test something
@utt.
expected
Failure_fast
@utt.
assert
Failure_fast
def
test4
(
self
):
# basic test that the optimization doesn't work with broadcasting
# ... It *could* be extended to,
...
...
theano/tests/unittest_tools.py
浏览文件 @
83a8b1f4
...
...
@@ -447,11 +447,16 @@ class AttemptManyTimes:
return
attempt_multiple_times
def
expected
Failure_fast
(
f
):
def
assert
Failure_fast
(
f
):
"""A Decorator to handle the test cases that are failing when
THEANO_FLAGS =cycle_detection='fast'.
"""
if
theano
.
config
.
cycle_detection
==
'fast'
:
return
unittest
.
expectedFailure
(
f
)
class
TestAssertion
(
unittest
.
TestCase
):
def
runTest
(
self
,
*
args
,
**
kwargs
):
with
self
.
assertRaises
(
Exception
):
f
(
*
args
,
**
kwargs
)
test_assertion
=
TestAssertion
()
return
test_assertion
else
:
return
f
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论