Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c555a320
提交
c555a320
authored
2月 10, 2011
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reference Trac tickets in KnownFailureTests error messages
上级
418f4dc8
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
42 行增加
和
27 行删除
+42
-27
test_basic.py
theano/tensor/tests/test_basic.py
+16
-8
test_blas.py
theano/tensor/tests/test_blas.py
+2
-2
test_complex.py
theano/tensor/tests/test_complex.py
+3
-3
test_opt.py
theano/tensor/tests/test_opt.py
+21
-14
没有找到文件。
theano/tensor/tests/test_basic.py
浏览文件 @
c555a320
...
@@ -2323,8 +2323,10 @@ class T_tensorfromscalar(unittest.TestCase):
...
@@ -2323,8 +2323,10 @@ class T_tensorfromscalar(unittest.TestCase):
self
.
failUnless
(
isinstance
(
v
,
numpy
.
ndarray
))
self
.
failUnless
(
isinstance
(
v
,
numpy
.
ndarray
))
self
.
failUnless
(
v
.
shape
==
(),
v
.
shape
)
self
.
failUnless
(
v
.
shape
==
(),
v
.
shape
)
@dec.knownfailureif
(
isinstance
(
get_default_mode
(),
theano
.
compile
.
debugmode
.
DebugMode
),
@dec.knownfailureif
(
"This test fail in DEBUG_MODE but this don't make theano generate some bad code. It is a trouble with DEBUG_MODE"
)
isinstance
(
get_default_mode
(),
theano
.
compile
.
debugmode
.
DebugMode
),
(
"This test fails in DEBUG_MODE, but the generated code is OK. "
"It is actually a problem of DEBUG_MODE, see #624."
))
def
test1
(
self
):
def
test1
(
self
):
s
=
scal
.
constant
(
56
)
s
=
scal
.
constant
(
56
)
t
=
as_tensor_variable
(
s
)
t
=
as_tensor_variable
(
s
)
...
@@ -2343,8 +2345,10 @@ class T_tensorfromscalar(unittest.TestCase):
...
@@ -2343,8 +2345,10 @@ class T_tensorfromscalar(unittest.TestCase):
self
.
failUnless
(
eval_outputs
([
g
])
==
1
)
self
.
failUnless
(
eval_outputs
([
g
])
==
1
)
class
T_scalarfromtensor
(
unittest
.
TestCase
):
class
T_scalarfromtensor
(
unittest
.
TestCase
):
@dec.knownfailureif
(
isinstance
(
get_default_mode
(),
theano
.
compile
.
debugmode
.
DebugMode
),
@dec.knownfailureif
(
"This test fail in DEBUG_MODE but this don't make theano generate some bad code. It is a trouble with DEBUG_MODE"
)
isinstance
(
get_default_mode
(),
theano
.
compile
.
debugmode
.
DebugMode
),
(
"This test fails in DEBUG_MODE, but the generated code is OK. "
"It is actually a problem of DEBUG_MODE, see #625."
))
def
test0
(
self
):
def
test0
(
self
):
tt
=
constant
(
56
)
#scal.constant(56)
tt
=
constant
(
56
)
#scal.constant(56)
ss
=
scalar_from_tensor
(
tt
)
ss
=
scalar_from_tensor
(
tt
)
...
@@ -3309,8 +3313,10 @@ def test_sum_overflow():
...
@@ -3309,8 +3313,10 @@ def test_sum_overflow():
f
=
function
([
a
],
sum
(
a
))
f
=
function
([
a
],
sum
(
a
))
assert
f
([
1
]
*
300
)
==
300
assert
f
([
1
]
*
300
)
==
300
@dec.knownfailureif
(
isinstance
(
get_default_mode
(),
theano
.
compile
.
debugmode
.
DebugMode
),
@dec.knownfailureif
(
"This test fail in DEBUG_MODE but this don't make theano generate some bad code. It is a trouble in DEBUG_MODE"
)
isinstance
(
get_default_mode
(),
theano
.
compile
.
debugmode
.
DebugMode
),
(
"This test fails in DEBUG_MODE, but the generated code is OK. "
"It is actually a problem of DEBUG_MODE, see #626."
))
def
test_default
():
def
test_default
():
x
,
y
=
scalars
(
'xy'
)
x
,
y
=
scalars
(
'xy'
)
z
=
default
(
x
,
y
)
z
=
default
(
x
,
y
)
...
@@ -3319,8 +3325,10 @@ def test_default():
...
@@ -3319,8 +3325,10 @@ def test_default():
assert
f
(
None
,
2
)
==
2
assert
f
(
None
,
2
)
==
2
assert
f
(
1
,
None
)
==
1
assert
f
(
1
,
None
)
==
1
@dec.knownfailureif
(
isinstance
(
get_default_mode
(),
theano
.
compile
.
debugmode
.
DebugMode
),
@dec.knownfailureif
(
"This test fail in DEBUG_MODE but this don't make theano generate some bad code. It is a trouble in DEBUG_MODE"
)
isinstance
(
get_default_mode
(),
theano
.
compile
.
debugmode
.
DebugMode
),
(
"This test fails in DEBUG_MODE, but the generated code is OK. "
"It is actually a problem of DEBUG_MODE, see #626."
))
def
test_default_state
():
def
test_default_state
():
x
,
y
=
scalars
(
'xy'
)
x
,
y
=
scalars
(
'xy'
)
print
config
.
floatX
print
config
.
floatX
...
...
theano/tensor/tests/test_blas.py
浏览文件 @
c555a320
...
@@ -549,13 +549,13 @@ def test_inplace0():
...
@@ -549,13 +549,13 @@ def test_inplace0():
raise
Failure
(
'gemm_inplace in graph'
)
raise
Failure
(
'gemm_inplace in graph'
)
assert
_dot22
in
[
n
.
op
for
n
in
f
.
maker
.
env
.
nodes
]
assert
_dot22
in
[
n
.
op
for
n
in
f
.
maker
.
env
.
nodes
]
raise
KnownFailureTest
(
"gemm not always inserted"
)
f
=
inplace_func
([
X
,
Y
,
Z
,
a
,
b
,
R
,
S
,
c
],
f
=
inplace_func
([
X
,
Y
,
Z
,
a
,
b
,
R
,
S
,
c
],
[
Z
*
(
c
*
Z
+
a
*
T
.
dot
(
X
,
Y
)
+
b
*
T
.
dot
(
R
,
S
)
.
T
)],
mode
=
'FAST_RUN'
)
[
Z
*
(
c
*
Z
+
a
*
T
.
dot
(
X
,
Y
)
+
b
*
T
.
dot
(
R
,
S
)
.
T
)],
mode
=
'FAST_RUN'
)
# gemm_inplace should be inserted here, to work in-place on Z*c
# gemm_inplace should be inserted here, to work in-place on Z*c
if
(
not
gemm_inplace
in
[
n
.
op
for
n
in
f
.
maker
.
env
.
nodes
]):
if
(
not
gemm_inplace
in
[
n
.
op
for
n
in
f
.
maker
.
env
.
nodes
]):
print
pp
(
f
.
maker
.
env
.
outputs
[
0
])
print
pp
(
f
.
maker
.
env
.
outputs
[
0
])
raise
Failure
(
'no gemm_inplace in graph'
)
#raise Failure('no gemm_inplace in graph')
raise
KnownFailureTest
(
"gemm not always inserted, see #415"
)
def
test_inplace1
():
def
test_inplace1
():
X
,
Y
,
Z
,
a
,
b
=
XYZab
()
X
,
Y
,
Z
,
a
,
b
=
XYZab
()
...
...
theano/tensor/tests/test_complex.py
浏览文件 @
c555a320
...
@@ -55,7 +55,7 @@ class TestRealImag(unittest.TestCase):
...
@@ -55,7 +55,7 @@ class TestRealImag(unittest.TestCase):
mval
=
numpy
.
asarray
(
rng
.
randn
(
2
,
5
))
mval
=
numpy
.
asarray
(
rng
.
randn
(
2
,
5
))
utt
.
verify_grad
(
f
,
[
mval
])
utt
.
verify_grad
(
f
,
[
mval
])
@dec.knownfailureif
(
True
,
"Complex grads not enabled"
)
@dec.knownfailureif
(
True
,
"Complex grads not enabled
, see #178
"
)
def
test_mul_mixed0
(
self
):
def
test_mul_mixed0
(
self
):
def
f
(
a
):
def
f
(
a
):
...
@@ -71,7 +71,7 @@ class TestRealImag(unittest.TestCase):
...
@@ -71,7 +71,7 @@ class TestRealImag(unittest.TestCase):
print
e
.
analytic_grad
print
e
.
analytic_grad
raise
raise
@dec.knownfailureif
(
True
,
"Complex grads not enabled"
)
@dec.knownfailureif
(
True
,
"Complex grads not enabled
, see #178
"
)
def
test_mul_mixed1
(
self
):
def
test_mul_mixed1
(
self
):
def
f
(
a
):
def
f
(
a
):
...
@@ -86,7 +86,7 @@ class TestRealImag(unittest.TestCase):
...
@@ -86,7 +86,7 @@ class TestRealImag(unittest.TestCase):
print
e
.
num_grad
.
gf
print
e
.
num_grad
.
gf
print
e
.
analytic_grad
print
e
.
analytic_grad
raise
raise
@dec.knownfailureif
(
True
,
"Complex grads not enabled"
)
@dec.knownfailureif
(
True
,
"Complex grads not enabled
, see #178
"
)
def
test_mul_mixed
(
self
):
def
test_mul_mixed
(
self
):
def
f
(
a
,
b
):
def
f
(
a
,
b
):
...
...
theano/tensor/tests/test_opt.py
浏览文件 @
c555a320
...
@@ -1136,7 +1136,8 @@ def test_log_add():
...
@@ -1136,7 +1136,8 @@ def test_log_add():
print
f
([
10000
],
[
10000
])
# causes overflow if handled incorrectly
print
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
KnownFailureTest
raise
KnownFailureTest
((
'log(add(exp)) is not stabilized when adding '
'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.
...
@@ -1710,19 +1711,25 @@ def test_constant_get_stabilized():
...
@@ -1710,19 +1711,25 @@ def test_constant_get_stabilized():
x2
=
T
.
scalar
()
x2
=
T
.
scalar
()
y2
=
T
.
log
(
1
+
T
.
exp
(
x2
))
y2
=
T
.
log
(
1
+
T
.
exp
(
x2
))
f2
=
theano
.
function
([
x2
],
y2
)
f2
=
theano
.
function
([
x2
],
y2
)
raise
KnownFailureTest
(
"Theano optimize constant before stabilization! This break stabilization optimization is some case!"
)
try
:
assert
len
(
f2
.
maker
.
env
.
toposort
())
==
1
assert
len
(
f2
.
maker
.
env
.
toposort
())
==
1
assert
f2
.
maker
.
env
.
toposort
()[
0
]
.
op
==
theano
.
tensor
.
nnet
.
sigm
.
softplus
assert
f2
.
maker
.
env
.
toposort
()[
0
]
.
op
==
theano
.
tensor
.
nnet
.
sigm
.
softplus
assert
f2
(
800
)
==
800
assert
f2
(
800
)
==
800
x
=
T
.
as_tensor_variable
(
800
)
x
=
T
.
as_tensor_variable
(
800
)
y
=
T
.
log
(
1
+
T
.
exp
(
x
))
y
=
T
.
log
(
1
+
T
.
exp
(
x
))
f
=
theano
.
function
([],
y
)
f
=
theano
.
function
([],
y
)
assert
len
(
f
.
maker
.
env
.
toposort
())
==
0
assert
len
(
f
.
maker
.
env
.
toposort
())
==
0
assert
numpy
.
isinf
(
f
())
assert
numpy
.
isinf
(
f
())
#When this error is fixed, the following line should be ok.
#When this error is fixed, the following line should be ok.
assert
f
()
==
800
,
f
()
assert
f
()
==
800
,
f
()
except
(
AssertionError
,
theano
.
compile
.
debugmode
.
InvalidValueError
):
raise
KnownFailureTest
((
"Theano optimizes constant before stabilization. "
"This breaks stabilization optimization in some cases. See #504."
))
class
T_local_switch_sink
(
unittest
.
TestCase
):
class
T_local_switch_sink
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论