Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
95c9d036
提交
95c9d036
authored
5月 04, 2015
作者:
David Warde-Farley
提交者:
Arnaud Bergeron
6月 22, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace deprecated unittest.TestCase method names.
上级
721d2b4e
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
21 行增加
和
21 行删除
+21
-21
test_function_module.py
theano/compile/tests/test_function_module.py
+1
-1
test_graph.py
theano/gof/tests/test_graph.py
+2
-2
test_blas.py
theano/tensor/tests/test_blas.py
+5
-5
test_blas_c.py
theano/tensor/tests/test_blas_c.py
+12
-12
test_nlinalg.py
theano/tensor/tests/test_nlinalg.py
+1
-1
没有找到文件。
theano/compile/tests/test_function_module.py
浏览文件 @
95c9d036
...
@@ -744,5 +744,5 @@ if __name__ == '__main__':
...
@@ -744,5 +744,5 @@ if __name__ == '__main__':
t
=
T_picklefunction
()
t
=
T_picklefunction
()
def
fu
(
b
):
def
fu
(
b
):
assert
b
assert
b
t
.
failUnless
=
fu
t
.
assertTrue
=
fu
t
.
test_deepcopy_shared_container
()
t
.
test_deepcopy_shared_container
()
theano/gof/tests/test_graph.py
浏览文件 @
95c9d036
...
@@ -317,8 +317,8 @@ class TestEval(unittest.TestCase):
...
@@ -317,8 +317,8 @@ class TestEval(unittest.TestCase):
self
.
w
=
2
*
self
.
z
self
.
w
=
2
*
self
.
z
def
test_eval
(
self
):
def
test_eval
(
self
):
self
.
assertEqual
s
(
self
.
w
.
eval
({
self
.
x
:
1.
,
self
.
y
:
2.
}),
6.
)
self
.
assertEqual
(
self
.
w
.
eval
({
self
.
x
:
1.
,
self
.
y
:
2.
}),
6.
)
self
.
assertEqual
s
(
self
.
w
.
eval
({
self
.
z
:
3
}),
6.
)
self
.
assertEqual
(
self
.
w
.
eval
({
self
.
z
:
3
}),
6.
)
self
.
assertTrue
(
hasattr
(
self
.
w
,
"_fn_cache"
),
self
.
assertTrue
(
hasattr
(
self
.
w
,
"_fn_cache"
),
"variable must have cache after eval"
)
"variable must have cache after eval"
)
self
.
assertFalse
(
hasattr
(
pickle
.
loads
(
pickle
.
dumps
(
self
.
w
)),
'_fn_cache'
),
self
.
assertFalse
(
hasattr
(
pickle
.
loads
(
pickle
.
dumps
(
self
.
w
)),
'_fn_cache'
),
...
...
theano/tensor/tests/test_blas.py
浏览文件 @
95c9d036
...
@@ -1548,13 +1548,13 @@ class TestGer_make_node(TestCase):
...
@@ -1548,13 +1548,13 @@ class TestGer_make_node(TestCase):
self
.
za
=
T
.
zscalar
()
self
.
za
=
T
.
zscalar
()
def
test_works_on_all_valid_dtypes
(
self
):
def
test_works_on_all_valid_dtypes
(
self
):
self
.
assertEqual
s
(
self
.
fm
.
type
,
self
.
assertEqual
(
self
.
fm
.
type
,
ger
(
self
.
fm
,
self
.
fa
,
self
.
fv
,
self
.
fv_2
)
.
type
)
ger
(
self
.
fm
,
self
.
fa
,
self
.
fv
,
self
.
fv_2
)
.
type
)
self
.
assertEqual
s
(
self
.
fm
.
type
,
self
.
assertEqual
(
self
.
fm
.
type
,
ger
(
self
.
fm
,
self
.
fa
,
self
.
fv
,
self
.
fv_2
)
.
type
)
ger
(
self
.
fm
,
self
.
fa
,
self
.
fv
,
self
.
fv_2
)
.
type
)
self
.
assertEqual
s
(
self
.
fm
.
type
,
self
.
assertEqual
(
self
.
fm
.
type
,
ger
(
self
.
fm
,
self
.
fa
,
self
.
fv
,
self
.
fv_2
)
.
type
)
ger
(
self
.
fm
,
self
.
fa
,
self
.
fv
,
self
.
fv_2
)
.
type
)
self
.
assertEqual
s
(
self
.
fm
.
type
,
self
.
assertEqual
(
self
.
fm
.
type
,
ger
(
self
.
fm
,
self
.
fa
,
self
.
fv
,
self
.
fv_2
)
.
type
)
ger
(
self
.
fm
,
self
.
fa
,
self
.
fv
,
self
.
fv_2
)
.
type
)
def
test_fails_on_invalid_dtypes
(
self
):
def
test_fails_on_invalid_dtypes
(
self
):
...
@@ -1570,7 +1570,7 @@ class TestGer_make_node(TestCase):
...
@@ -1570,7 +1570,7 @@ class TestGer_make_node(TestCase):
self
.
assertRaises
(
TypeError
,
self
.
assertRaises
(
TypeError
,
ger
,
self
.
fm
,
self
.
fv1
,
self
.
fv
,
self
.
fv_2
)
ger
,
self
.
fm
,
self
.
fv1
,
self
.
fv
,
self
.
fv_2
)
# actually doing the aforementioned dimshuffle makes it work
# actually doing the aforementioned dimshuffle makes it work
self
.
assertEqual
s
(
self
.
fm
.
type
,
self
.
assertEqual
(
self
.
fm
.
type
,
ger
(
self
.
fm
,
self
.
fv1
.
dimshuffle
(),
self
.
fv
,
self
.
fv_2
)
.
type
)
ger
(
self
.
fm
,
self
.
fv1
.
dimshuffle
(),
self
.
fv
,
self
.
fv_2
)
.
type
)
def
test_fails_for_nonmatrix_A
(
self
):
def
test_fails_for_nonmatrix_A
(
self
):
...
...
theano/tensor/tests/test_blas_c.py
浏览文件 @
95c9d036
...
@@ -57,23 +57,23 @@ class TestCGer(TestCase, TestOptimizationMixin):
...
@@ -57,23 +57,23 @@ class TestCGer(TestCase, TestOptimizationMixin):
return
tensor
.
as_tensor_variable
(
numpy
.
asarray
(
bval
,
dtype
=
self
.
dtype
))
return
tensor
.
as_tensor_variable
(
numpy
.
asarray
(
bval
,
dtype
=
self
.
dtype
))
def
test_eq
(
self
):
def
test_eq
(
self
):
self
.
assert
_
(
CGer
(
True
)
==
CGer
(
True
))
self
.
assert
True
(
CGer
(
True
)
==
CGer
(
True
))
self
.
assert
_
(
CGer
(
False
)
==
CGer
(
False
))
self
.
assert
True
(
CGer
(
False
)
==
CGer
(
False
))
self
.
assert
_
(
CGer
(
False
)
!=
CGer
(
True
))
self
.
assert
True
(
CGer
(
False
)
!=
CGer
(
True
))
self
.
assert
_
(
CGer
(
True
)
!=
ScipyGer
(
True
))
self
.
assert
True
(
CGer
(
True
)
!=
ScipyGer
(
True
))
self
.
assert
_
(
CGer
(
False
)
!=
ScipyGer
(
False
))
self
.
assert
True
(
CGer
(
False
)
!=
ScipyGer
(
False
))
self
.
assert
_
(
CGer
(
True
)
!=
Ger
(
True
))
self
.
assert
True
(
CGer
(
True
)
!=
Ger
(
True
))
self
.
assert
_
(
CGer
(
False
)
!=
Ger
(
False
))
self
.
assert
True
(
CGer
(
False
)
!=
Ger
(
False
))
# assert that eq works for non-CGer instances
# assert that eq works for non-CGer instances
self
.
assert
_
(
CGer
(
False
)
is
not
None
)
self
.
assert
True
(
CGer
(
False
)
is
not
None
)
self
.
assert
_
(
CGer
(
True
)
is
not
None
)
self
.
assert
True
(
CGer
(
True
)
is
not
None
)
def
test_hash
(
self
):
def
test_hash
(
self
):
self
.
assert
_
(
hash
(
CGer
(
True
))
==
hash
(
CGer
(
True
)))
self
.
assert
True
(
hash
(
CGer
(
True
))
==
hash
(
CGer
(
True
)))
self
.
assert
_
(
hash
(
CGer
(
False
))
==
hash
(
CGer
(
False
)))
self
.
assert
True
(
hash
(
CGer
(
False
))
==
hash
(
CGer
(
False
)))
self
.
assert
_
(
hash
(
CGer
(
False
))
!=
hash
(
CGer
(
True
)))
self
.
assert
True
(
hash
(
CGer
(
False
))
!=
hash
(
CGer
(
True
)))
def
test_optimization_pipeline
(
self
):
def
test_optimization_pipeline
(
self
):
f
=
self
.
function
([
self
.
x
,
self
.
y
],
tensor
.
outer
(
self
.
x
,
self
.
y
))
f
=
self
.
function
([
self
.
x
,
self
.
y
],
tensor
.
outer
(
self
.
x
,
self
.
y
))
...
...
theano/tensor/tests/test_nlinalg.py
浏览文件 @
95c9d036
...
@@ -389,7 +389,7 @@ class test_Eig(utt.InferShapeTester):
...
@@ -389,7 +389,7 @@ class test_Eig(utt.InferShapeTester):
def
test_eval
(
self
):
def
test_eval
(
self
):
A
=
theano
.
tensor
.
matrix
(
dtype
=
self
.
dtype
)
A
=
theano
.
tensor
.
matrix
(
dtype
=
self
.
dtype
)
self
.
assertEqual
s
([
e
.
eval
({
A
:
[[
1
]]})
for
e
in
self
.
op
(
A
)],
self
.
assertEqual
([
e
.
eval
({
A
:
[[
1
]]})
for
e
in
self
.
op
(
A
)],
[[
1.0
],
[[
1.0
]]])
[[
1.0
],
[[
1.0
]]])
x
=
[[
0
,
1
],
[
1
,
0
]]
x
=
[[
0
,
1
],
[
1
,
0
]]
w
,
v
=
[
e
.
eval
({
A
:
x
})
for
e
in
self
.
op
(
A
)]
w
,
v
=
[
e
.
eval
({
A
:
x
})
for
e
in
self
.
op
(
A
)]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论