Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
95b4fec5
提交
95b4fec5
authored
6月 09, 2014
作者:
abergeron
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1906 from nouiz/tests
fix tests
上级
4eff8975
dc9da377
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
24 行增加
和
6 行删除
+24
-6
test_link.py
theano/gof/tests/test_link.py
+16
-3
fftconv.py
theano/sandbox/cuda/fftconv.py
+0
-1
test_fftconv.py
theano/sandbox/cuda/tests/test_fftconv.py
+8
-2
没有找到文件。
theano/gof/tests/test_link.py
浏览文件 @
95b4fec5
...
@@ -3,6 +3,7 @@ import unittest
...
@@ -3,6 +3,7 @@ import unittest
import
numpy
import
numpy
import
theano
from
theano.gof
import
graph
from
theano.gof
import
graph
from
theano.gof.graph
import
Variable
,
Apply
,
Constant
from
theano.gof.graph
import
Variable
,
Apply
,
Constant
from
theano.gof.type
import
Type
from
theano.gof.type
import
Type
...
@@ -192,9 +193,21 @@ def test_container_deepcopy():
...
@@ -192,9 +193,21 @@ def test_container_deepcopy():
This is a test to a work around a NumPy bug.
This is a test to a work around a NumPy bug.
"""
"""
t
=
theano
.
tensor
.
scalar
()
t
=
theano
.
tensor
.
scalar
()
v
=
numpy
.
asarray
(
0.
)
# It seam that numpy.asarray(0.).astype(floatX) can return a numpy
# scalar with some NumPy Version. So we call numpy.asarray with
# the dtype parameter.
v
=
numpy
.
asarray
(
0.
,
dtype
=
theano
.
config
.
floatX
)
assert
isinstance
(
v
,
numpy
.
ndarray
),
type
(
v
)
for
readonly
in
[
True
,
False
]:
for
readonly
in
[
True
,
False
]:
c
=
Container
(
t
,
[
v
],
readonly
=
readonly
)
c
=
Container
(
t
,
[
v
],
readonly
=
readonly
)
assert
isinstance
(
c
.
storage
[
0
],
numpy
.
ndarray
)
assert
isinstance
(
c
.
storage
[
0
],
numpy
.
ndarray
),
(
c
.
storage
[
0
],
type
(
c
.
storage
[
0
]))
assert
c
.
storage
[
0
]
.
dtype
==
v
.
dtype
,
(
c
.
storage
[
0
]
.
dtype
,
v
.
dtype
)
assert
c
.
storage
[
0
]
.
dtype
==
c
.
type
.
dtype
,
(
c
.
storage
[
0
]
.
dtype
,
c
.
type
.
dtype
)
d
=
deepcopy
(
c
)
d
=
deepcopy
(
c
)
assert
isinstance
(
d
.
storage
[
0
],
numpy
.
ndarray
)
assert
isinstance
(
d
.
storage
[
0
],
numpy
.
ndarray
),
(
d
.
storage
[
0
],
type
(
d
.
storage
[
0
]))
assert
d
.
storage
[
0
]
.
dtype
==
v
.
dtype
,
(
d
.
storage
[
0
]
.
dtype
,
v
.
dtype
)
assert
d
.
storage
[
0
]
.
dtype
==
c
.
type
.
dtype
,
(
d
.
storage
[
0
]
.
dtype
,
c
.
type
.
dtype
)
theano/sandbox/cuda/fftconv.py
浏览文件 @
95b4fec5
...
@@ -9,7 +9,6 @@ from theano.sandbox.cuda import cuda_available, GpuOp
...
@@ -9,7 +9,6 @@ from theano.sandbox.cuda import cuda_available, GpuOp
if
cuda_available
:
if
cuda_available
:
from
theano.sandbox.cuda
import
(
basic_ops
,
CudaNdarrayType
,
from
theano.sandbox.cuda
import
(
basic_ops
,
CudaNdarrayType
,
CudaNdarray
)
CudaNdarray
)
import
theano.misc.pycuda_init
from
theano.misc.pycuda_init
import
pycuda_available
from
theano.misc.pycuda_init
import
pycuda_available
if
pycuda_available
:
if
pycuda_available
:
import
pycuda.gpuarray
import
pycuda.gpuarray
...
...
theano/sandbox/cuda/tests/test_fftconv.py
浏览文件 @
95b4fec5
...
@@ -7,8 +7,14 @@ from theano.tests import unittest_tools as utt
...
@@ -7,8 +7,14 @@ from theano.tests import unittest_tools as utt
# Skip tests if cuda_ndarray is not available.
# Skip tests if cuda_ndarray is not available.
from
nose.plugins.skip
import
SkipTest
from
nose.plugins.skip
import
SkipTest
import
theano.sandbox.cuda
as
cuda_ndarray
import
theano.sandbox.cuda
as
cuda_ndarray
if
cuda_ndarray
.
cuda_available
==
False
:
if
not
cuda_ndarray
.
cuda_available
:
raise
SkipTest
(
'Optional package cuda disabled'
)
raise
SkipTest
(
'Optional package cuda not available'
)
from
theano.misc.pycuda_init
import
pycuda_available
if
not
pycuda_available
:
raise
SkipTest
(
'Optional package pycuda not available'
)
from
theano.sandbox.cuda.fftconv
import
scikits_cuda_available
if
not
scikits_cuda_available
:
raise
SkipTest
(
'Optional package scikits.cuda not available'
)
from
theano.sandbox.cuda
import
float32_shared_constructor
as
shared
from
theano.sandbox.cuda
import
float32_shared_constructor
as
shared
import
theano.sandbox.cuda.fftconv
import
theano.sandbox.cuda.fftconv
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论