Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c2b33a27
提交
c2b33a27
authored
2月 22, 2010
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix cuda tests in FAST_COMPILE. Too many gpu op don't implement the perform methode.
上级
f7e2eec4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
23 行增加
和
6 行删除
+23
-6
test_basic_ops.py
theano/sandbox/cuda/tests/test_basic_ops.py
+6
-2
test_blas.py
theano/sandbox/cuda/tests/test_blas.py
+5
-1
test_conv_cuda_ndarray.py
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
+8
-2
test_opt.py
theano/sandbox/cuda/tests/test_opt.py
+4
-1
没有找到文件。
theano/sandbox/cuda/tests/test_basic_ops.py
浏览文件 @
c2b33a27
...
@@ -19,8 +19,12 @@ import theano.sandbox.cuda as cuda
...
@@ -19,8 +19,12 @@ import theano.sandbox.cuda as cuda
import
theano.compile.mode
import
theano.compile.mode
from
theano.tests
import
unittest_tools
as
utt
from
theano.tests
import
unittest_tools
as
utt
mode_with_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
including
(
'gpu'
)
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
mode_without_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
excluding
(
'gpu'
)
mode_with_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
including
(
'gpu'
)
mode_without_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
excluding
(
'gpu'
)
else
:
mode_with_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
including
(
'gpu'
)
mode_without_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
excluding
(
'gpu'
)
def
tes_use
():
def
tes_use
():
tcn
.
use
()
tcn
.
use
()
...
...
theano/sandbox/cuda/tests/test_blas.py
浏览文件 @
c2b33a27
...
@@ -17,7 +17,11 @@ from theano.tensor.signal.downsample import DownsampleFactorMax
...
@@ -17,7 +17,11 @@ from theano.tensor.signal.downsample import DownsampleFactorMax
import
theano.compile.mode
import
theano.compile.mode
mode_with_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
including
(
'gpu'
)
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
mode_with_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
including
(
'gpu'
)
else
:
mode_with_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
including
(
'gpu'
)
def
my_rand
(
*
shape
):
def
my_rand
(
*
shape
):
return
theano
.
_asarray
(
numpy
.
random
.
rand
(
*
shape
),
dtype
=
'float32'
)
return
theano
.
_asarray
(
numpy
.
random
.
rand
(
*
shape
),
dtype
=
'float32'
)
...
...
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
浏览文件 @
c2b33a27
...
@@ -7,7 +7,13 @@ from nose.plugins.skip import SkipTest
...
@@ -7,7 +7,13 @@ 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
cuda_ndarray
.
cuda_available
==
False
:
raise
SkipTest
(
'Optional package cuda disabled'
)
raise
SkipTest
(
'Optional package cuda disabled'
)
#needed as the gpu conv don't have a perform implementation.
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
theano_mode
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
including
(
'gpu'
)
else
:
theano_mode
=
theano
.
compile
.
mode
.
get_default_mode
()
.
including
(
'gpu'
)
cuda_tensor4
=
cuda_ndarray
.
CudaNdarrayType
([
False
]
*
4
)
cuda_tensor4
=
cuda_ndarray
.
CudaNdarrayType
([
False
]
*
4
)
def
py_conv_valid_numpy
(
img
,
kern
):
def
py_conv_valid_numpy
(
img
,
kern
):
...
@@ -86,7 +92,7 @@ def _params_allgood(ishape, kshape, mode, subsample=(1,1), img_stride=(1,1), ker
...
@@ -86,7 +92,7 @@ def _params_allgood(ishape, kshape, mode, subsample=(1,1), img_stride=(1,1), ker
i
=
cuda_tensor4
()
i
=
cuda_tensor4
()
k
=
cuda_tensor4
()
k
=
cuda_tensor4
()
op
=
theano
.
sandbox
.
cuda
.
blas
.
GpuConv
(
border_mode
=
mode
,
subsample
=
subsample
,
version
=
version
,
verbose
=
verbose
)(
i
,
k
)
op
=
theano
.
sandbox
.
cuda
.
blas
.
GpuConv
(
border_mode
=
mode
,
subsample
=
subsample
,
version
=
version
,
verbose
=
verbose
)(
i
,
k
)
f
=
theano
.
function
([
i
,
k
],
op
)
f
=
theano
.
function
([
i
,
k
],
op
,
mode
=
theano_mode
)
gpuval
=
f
(
img
,
kern
)
gpuval
=
f
(
img
,
kern
)
t2
=
time
.
time
()
t2
=
time
.
time
()
for
i
in
range
(
nb_iter
):
for
i
in
range
(
nb_iter
):
...
...
theano/sandbox/cuda/tests/test_opt.py
浏览文件 @
c2b33a27
...
@@ -13,7 +13,10 @@ if cuda_ndarray.cuda_available == False:
...
@@ -13,7 +13,10 @@ if cuda_ndarray.cuda_available == False:
import
theano.compile.mode
import
theano.compile.mode
mode_with_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
including
(
'gpu'
)
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
mode_with_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
including
(
'gpu'
)
else
:
mode_with_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
including
(
'gpu'
)
import
theano.sandbox.cuda
as
cuda
import
theano.sandbox.cuda
as
cuda
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论