Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
388628a9
提交
388628a9
authored
2月 19, 2014
作者:
Markus Roth
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Refactor. Use decorators for skipping cuda-only-tests."
There is no more use for choosing single tests to skip. This reverts commit
99295012
.
上级
3c349c5c
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
8 行删除
+6
-8
test_var.py
theano/sandbox/cuda/tests/test_var.py
+6
-8
没有找到文件。
theano/sandbox/cuda/tests/test_var.py
浏览文件 @
388628a9
import
unittest
import
unittest
import
numpy
import
numpy
from
n
umpy.testing.decorators
import
skipif
from
n
ose.plugins.skip
import
SkipTest
import
theano
import
theano
from
theano
import
tensor
from
theano
import
tensor
...
@@ -8,10 +8,13 @@ from theano import tensor
...
@@ -8,10 +8,13 @@ from theano import tensor
from
theano.sandbox.cuda.var
import
float32_shared_constructor
as
f32sc
from
theano.sandbox.cuda.var
import
float32_shared_constructor
as
f32sc
from
theano.sandbox.cuda
import
CudaNdarrayType
,
cuda_available
from
theano.sandbox.cuda
import
CudaNdarrayType
,
cuda_available
import
theano.sandbox.cuda
as
cuda
import
theano.sandbox.cuda
as
cuda
# Skip test if cuda_ndarray is not available.
if
cuda_available
==
False
:
raise
SkipTest
(
'Optional package cuda disabled'
)
@skipif
(
not
cuda_available
,
msg
=
'Optional package cuda disabled'
)
def
test_float32_shared_constructor
():
def
test_float32_shared_constructor
():
npy_row
=
numpy
.
zeros
((
1
,
10
),
dtype
=
'float32'
)
npy_row
=
numpy
.
zeros
((
1
,
10
),
dtype
=
'float32'
)
def
eq
(
a
,
b
):
def
eq
(
a
,
b
):
...
@@ -37,7 +40,7 @@ def test_float32_shared_constructor():
...
@@ -37,7 +40,7 @@ def test_float32_shared_constructor():
f32sc
(
numpy
.
zeros
((
2
,
3
,
4
,
5
),
dtype
=
'float32'
))
.
type
,
f32sc
(
numpy
.
zeros
((
2
,
3
,
4
,
5
),
dtype
=
'float32'
))
.
type
,
CudaNdarrayType
((
False
,)
*
4
))
CudaNdarrayType
((
False
,)
*
4
))
@skipif
(
not
cuda_available
,
msg
=
'Optional package cuda disabled'
)
def
test_givens
():
def
test_givens
():
# Test that you can use a TensorType expression to replace a
# Test that you can use a TensorType expression to replace a
# CudaNdarrayType in the givens dictionary.
# CudaNdarrayType in the givens dictionary.
...
@@ -53,7 +56,6 @@ class T_updates(unittest.TestCase):
...
@@ -53,7 +56,6 @@ class T_updates(unittest.TestCase):
# Test that you can use a TensorType expression to update a
# Test that you can use a TensorType expression to update a
# CudaNdarrayType in the updates dictionary.
# CudaNdarrayType in the updates dictionary.
@skipif
(
not
cuda_available
,
msg
=
'Optional package cuda disabled'
)
def
test_1
(
self
):
def
test_1
(
self
):
data
=
numpy
.
float32
([
1
,
2
,
3
,
4
])
data
=
numpy
.
float32
([
1
,
2
,
3
,
4
])
x
=
f32sc
(
data
)
x
=
f32sc
(
data
)
...
@@ -65,7 +67,6 @@ class T_updates(unittest.TestCase):
...
@@ -65,7 +67,6 @@ class T_updates(unittest.TestCase):
f
=
theano
.
function
([],
y
,
updates
=
[(
x
,
cuda
.
gpu_from_host
(
x
+
1
))])
f
=
theano
.
function
([],
y
,
updates
=
[(
x
,
cuda
.
gpu_from_host
(
x
+
1
))])
f
()
f
()
@skipif
(
not
cuda_available
,
msg
=
'Optional package cuda disabled'
)
def
test_2
(
self
):
def
test_2
(
self
):
# This test case uses code mentionned in #698
# This test case uses code mentionned in #698
data
=
numpy
.
random
.
rand
(
10
,
10
)
.
astype
(
'float32'
)
data
=
numpy
.
random
.
rand
(
10
,
10
)
.
astype
(
'float32'
)
...
@@ -79,7 +80,6 @@ class T_updates(unittest.TestCase):
...
@@ -79,7 +80,6 @@ class T_updates(unittest.TestCase):
updates
=
output_updates
,
givens
=
output_givens
)
updates
=
output_updates
,
givens
=
output_givens
)
output_func
()
output_func
()
@skipif
(
not
cuda_available
,
msg
=
'Optional package cuda disabled'
)
def
test_err_ndim
(
self
):
def
test_err_ndim
(
self
):
# Test that we raise a good error message when we don't
# Test that we raise a good error message when we don't
# have the same number of dimensions.
# have the same number of dimensions.
...
@@ -92,7 +92,6 @@ class T_updates(unittest.TestCase):
...
@@ -92,7 +92,6 @@ class T_updates(unittest.TestCase):
updates
=
[(
output_var
,
updates
=
[(
output_var
,
output_var
.
sum
())])
output_var
.
sum
())])
@skipif
(
not
cuda_available
,
msg
=
'Optional package cuda disabled'
)
def
test_err_broadcast
(
self
):
def
test_err_broadcast
(
self
):
# Test that we raise a good error message when we don't
# Test that we raise a good error message when we don't
# have the same number of dimensions.
# have the same number of dimensions.
...
@@ -105,7 +104,6 @@ class T_updates(unittest.TestCase):
...
@@ -105,7 +104,6 @@ class T_updates(unittest.TestCase):
updates
=
[(
output_var
,
updates
=
[(
output_var
,
output_var
.
sum
()
.
dimshuffle
(
'x'
,
'x'
))])
output_var
.
sum
()
.
dimshuffle
(
'x'
,
'x'
))])
@skipif
(
not
cuda_available
,
msg
=
'Optional package cuda disabled'
)
def
test_broadcast
(
self
):
def
test_broadcast
(
self
):
# Test that we can rebroadcast
# Test that we can rebroadcast
data
=
numpy
.
random
.
rand
(
10
,
10
)
.
astype
(
'float32'
)
data
=
numpy
.
random
.
rand
(
10
,
10
)
.
astype
(
'float32'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论