Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d1f66a2f
提交
d1f66a2f
authored
5月 23, 2014
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix tests so that they pass and test what we want.
上级
7a10c464
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
11 行删除
+13
-11
fftconv.py
theano/sandbox/cuda/fftconv.py
+2
-1
test_fftconv.py
theano/sandbox/cuda/tests/test_fftconv.py
+11
-10
没有找到文件。
theano/sandbox/cuda/fftconv.py
浏览文件 @
d1f66a2f
...
@@ -4,7 +4,8 @@ import numpy as np
...
@@ -4,7 +4,8 @@ import numpy as np
import
theano
import
theano
import
theano.tensor
as
T
import
theano.tensor
as
T
from
theano.sandbox.cuda
import
GpuOp
,
basic_ops
,
CudaNdarrayType
from
theano.sandbox.cuda
import
(
GpuOp
,
basic_ops
,
CudaNdarrayType
,
CudaNdarray
)
import
scikits.cuda
import
scikits.cuda
from
scikits.cuda
import
fft
,
cublas
,
misc
from
scikits.cuda
import
fft
,
cublas
,
misc
...
...
theano/sandbox/cuda/tests/test_fftconv.py
浏览文件 @
d1f66a2f
...
@@ -2,7 +2,7 @@ import unittest
...
@@ -2,7 +2,7 @@ import unittest
import
numpy
import
numpy
import
theano
import
theano
from
theano
import
unittest_tools
as
utt
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
...
@@ -10,7 +10,7 @@ import theano.sandbox.cuda as cuda_ndarray
...
@@ -10,7 +10,7 @@ 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'
)
import
theano.sandbox.cuda.
float32_shared_constructor
as
shared
from
theano.sandbox.cuda
import
float32_shared_constructor
as
shared
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
if
theano
.
config
.
mode
==
'FAST_COMPILE'
:
mode_with_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
including
(
'gpu'
)
mode_with_gpu
=
theano
.
compile
.
mode
.
get_mode
(
'FAST_RUN'
)
.
including
(
'gpu'
)
...
@@ -68,15 +68,16 @@ class TestConv2dFFT(unittest.TestCase):
...
@@ -68,15 +68,16 @@ class TestConv2dFFT(unittest.TestCase):
conv
=
theano
.
tensor
.
nnet
.
conv
.
conv2d
(
inputs
,
filters
)
conv
=
theano
.
tensor
.
nnet
.
conv
.
conv2d
(
inputs
,
filters
)
mode
=
mode_with_gpu
.
optimizer_including
(
'conv2d
_fft_valid'
)
mode
=
mode_with_gpu
.
including
(
'conv
_fft_valid'
)
f_ref
=
theano
.
function
([],
conv
)
f_ref
=
theano
.
function
([],
conv
)
f_fft
=
theano
.
function
([],
conv
,
mode
=
mode
_with_gpu
)
f_fft
=
theano
.
function
([],
conv
,
mode
=
mode
)
# make sure we inserted the fft trickery
# make sure we inserted the fft trickery
topo
=
f_fft
.
maker
.
fgraph
.
toposort
()
topo
=
f_fft
.
maker
.
fgraph
.
toposort
()
assert
len
(
op
for
op
in
topo
assert
sum
(
isinstance
(
n
.
op
,
theano
.
sandbox
.
cuda
.
fftconv
.
CuFFTOp
)
if
isinstance
(
op
,
theano
.
sandbox
.
cuda
.
fftconv
.
CuFFTOp
))
==
1
for
n
in
topo
)
==
2
res_ref
=
f_ref
()
res_ref
=
f_ref
()
res_fft
=
f_fft
()
res_fft
=
f_fft
()
...
@@ -96,15 +97,15 @@ class TestConv2dFFT(unittest.TestCase):
...
@@ -96,15 +97,15 @@ class TestConv2dFFT(unittest.TestCase):
conv
=
theano
.
tensor
.
nnet
.
conv
.
conv2d
(
inputs
,
filters
,
conv
=
theano
.
tensor
.
nnet
.
conv
.
conv2d
(
inputs
,
filters
,
border_mode
=
'full'
)
border_mode
=
'full'
)
mode
=
mode_with_gpu
.
optimizer_including
(
'conv2d
_fft_full'
)
mode
=
mode_with_gpu
.
including
(
'conv
_fft_full'
)
f_ref
=
theano
.
function
([],
conv
)
f_ref
=
theano
.
function
([],
conv
)
f_fft
=
theano
.
function
([],
conv
,
mode
=
mode
_with_gpu
)
f_fft
=
theano
.
function
([],
conv
,
mode
=
mode
)
# make sure we inserted the fft trickery
# make sure we inserted the fft trickery
topo
=
f_fft
.
maker
.
fgraph
.
toposort
()
topo
=
f_fft
.
maker
.
fgraph
.
toposort
()
assert
len
(
op
for
op
in
topo
assert
sum
(
isinstance
(
n
.
op
,
theano
.
sandbox
.
cuda
.
fftconv
.
CuFFTOp
)
if
isinstance
(
op
,
theano
.
sandbox
.
cuda
.
fftconv
.
CuFFTOp
))
==
1
for
n
in
topo
)
==
2
res_ref
=
f_ref
()
res_ref
=
f_ref
()
res_fft
=
f_fft
()
res_fft
=
f_fft
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论