Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0f146f60
提交
0f146f60
authored
10月 22, 2014
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix optimization crash and test crash due to new gpu conv default.
上级
b75b37c3
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
18 行增加
和
2 行删除
+18
-2
opt.py
theano/sandbox/cuda/opt.py
+8
-0
test_conv_cuda_ndarray.py
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
+5
-1
test_mlp.py
theano/sandbox/cuda/tests/test_mlp.py
+5
-1
没有找到文件。
theano/sandbox/cuda/opt.py
浏览文件 @
0f146f60
...
@@ -1123,11 +1123,19 @@ def local_gpu_conv(node):
...
@@ -1123,11 +1123,19 @@ def local_gpu_conv(node):
if
theano
.
sandbox
.
cuda
.
dnn
.
dnn_available
():
if
theano
.
sandbox
.
cuda
.
dnn
.
dnn_available
():
repl
=
local_gpu_conv_legacy
.
transform
(
node
)
repl
=
local_gpu_conv_legacy
.
transform
(
node
)
if
repl
:
if
repl
:
if
isinstance
(
repl
[
0
]
.
owner
.
op
,
GpuConv
):
n
=
repl
[
0
]
.
owner
add_transfer
=
False
else
:
n
=
repl
[
0
]
.
owner
.
inputs
[
0
]
.
owner
n
=
repl
[
0
]
.
owner
.
inputs
[
0
]
.
owner
assert
isinstance
(
n
.
op
,
GpuConv
)
assert
isinstance
(
n
.
op
,
GpuConv
)
add_transfer
=
True
ret
=
theano
.
sandbox
.
cuda
.
dnn
.
local_conv_dnn
.
transform
(
n
)
ret
=
theano
.
sandbox
.
cuda
.
dnn
.
local_conv_dnn
.
transform
(
n
)
if
ret
:
if
ret
:
if
add_transfer
:
return
[
host_from_gpu
(
ret
[
0
])]
return
[
host_from_gpu
(
ret
[
0
])]
else
:
return
ret
# If dnn isn't avail, the local_gpu_conv_legacy wil introduce the
# If dnn isn't avail, the local_gpu_conv_legacy wil introduce the
# legacy opt. Then the local_conv_gemm will convert it to gemm
# legacy opt. Then the local_conv_gemm will convert it to gemm
# opt.
# opt.
...
...
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
浏览文件 @
0f146f60
...
@@ -747,6 +747,10 @@ def test_dnn_subsample():
...
@@ -747,6 +747,10 @@ def test_dnn_subsample():
class
TestConv2DGPU
(
unittest
.
TestCase
):
class
TestConv2DGPU
(
unittest
.
TestCase
):
conv_ops
=
(
cuda
.
blas
.
GpuConv
,
cuda
.
dnn
.
GpuDnnConvBase
,
cuda
.
blas
.
BaseGpuCorrMM
)
def
test_logical_shapes
(
self
):
def
test_logical_shapes
(
self
):
seed_rng
()
seed_rng
()
for
stride
in
range
(
1
,
4
):
for
stride
in
range
(
1
,
4
):
...
@@ -773,7 +777,7 @@ class TestConv2DGPU(unittest.TestCase):
...
@@ -773,7 +777,7 @@ class TestConv2DGPU(unittest.TestCase):
func
=
theano
.
function
([
a
,
A
],
image_estimate
,
mode
=
theano_mode
)
func
=
theano
.
function
([
a
,
A
],
image_estimate
,
mode
=
theano_mode
)
#theano.printing.debugprint(func,)
#theano.printing.debugprint(func,)
assert
any
([
isinstance
(
node
.
op
,
theano
.
sandbox
.
cuda
.
blas
.
GpuConv
)
assert
any
([
isinstance
(
node
.
op
,
self
.
conv_ops
)
for
node
in
func
.
maker
.
fgraph
.
toposort
()])
for
node
in
func
.
maker
.
fgraph
.
toposort
()])
a_in
=
numpy
.
random
.
randn
(
*
featshp
)
.
astype
(
"float32"
)
a_in
=
numpy
.
random
.
randn
(
*
featshp
)
.
astype
(
"float32"
)
...
...
theano/sandbox/cuda/tests/test_mlp.py
浏览文件 @
0f146f60
...
@@ -396,7 +396,11 @@ def build_conv_nnet2_classif(use_gpu, isize, ksize, n_batch,
...
@@ -396,7 +396,11 @@ def build_conv_nnet2_classif(use_gpu, isize, ksize, n_batch,
if
use_gpu
:
if
use_gpu
:
# Check that GpuConv is used
# Check that GpuConv is used
topo
=
train
.
maker
.
fgraph
.
toposort
()
topo
=
train
.
maker
.
fgraph
.
toposort
()
assert
len
([
n
for
n
in
topo
if
isinstance
(
n
.
op
,
tcn
.
blas
.
GpuConv
)])
>
0
conv_ops
=
(
tcn
.
blas
.
GpuConv
,
tcn
.
dnn
.
GpuDnnConvBase
,
tcn
.
blas
.
BaseGpuCorrMM
)
assert
len
([
n
for
n
in
topo
if
isinstance
(
n
.
op
,
conv_ops
)])
>
0
shape_target
=
(
n_batch
,
n_out
)
shape_target
=
(
n_batch
,
n_out
)
return
train
,
params
,
shape_img
,
shape_target
,
mode
return
train
,
params
,
shape_img
,
shape_target
,
mode
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论