Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
527b324e
提交
527b324e
authored
7月 25, 2017
作者:
affanv14
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add conv3d2d optimizer
上级
f499af62
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
28 行增加
和
1 行删除
+28
-1
opt.py
theano/gpuarray/opt.py
+28
-1
没有找到文件。
theano/gpuarray/opt.py
浏览文件 @
527b324e
...
...
@@ -24,7 +24,7 @@ from theano.scalar.basic import log, neg, true_div
from
theano.scalar.basic_scipy
import
Erfinv
,
Erfcinv
from
theano.scan_module
import
scan_utils
,
scan_op
,
scan_opt
from
theano.tensor.nnet
import
bn
from
theano.tensor.nnet
import
bn
,
conv3d2d
from
theano.tensor.nnet.conv
import
ConvOp
from
theano.tensor.nnet.blocksparse
import
SparseBlockGemv
,
SparseBlockOuter
from
theano.tensor.nnet.abstract_conv
import
(
BaseAbstractConv
,
...
...
@@ -1739,6 +1739,32 @@ def local_abstractconv3d_gemm(node):
return
[
rval
]
@local_optimizer
([
AbstractConv3d
])
def
local_abstractconv3d2d
(
node
):
if
not
isinstance
(
node
.
op
,
AbstractConv3d
):
return
None
img
,
kern
=
node
.
inputs
if
(
not
isinstance
(
img
.
type
,
GpuArrayType
)
or
not
isinstance
(
kern
.
type
,
GpuArrayType
)):
return
None
ctx
=
infer_context_name
(
img
,
kern
)
border_mode
=
node
.
op
.
border_mode
subsample
=
node
.
op
.
subsample
filter_dilation
=
node
.
op
.
filter_dilation
if
subsample
==
(
1
,
1
,
1
)
and
filter_dilation
==
(
1
,
1
,
1
):
rval
=
conv3d2d
.
conv3d
(
gpu_contiguous
(
img
.
dimshuffle
(
0
,
2
,
1
,
3
,
4
)),
gpu_contiguous
(
kern
.
dimshuffle
(
0
,
2
,
1
,
3
,
4
)),
border_mode
=
border_mode
)
rval
=
as_gpuarray_variable
(
rval
.
dimshuffle
(
0
,
2
,
1
,
3
,
4
),
context_name
=
ctx
)
return
[
rval
]
else
:
return
None
@local_optimizer
([
AbstractConv2d_gradWeights
])
def
local_abstractconv_gradweights_gemm
(
node
):
if
not
isinstance
(
node
.
op
,
AbstractConv2d_gradWeights
):
...
...
@@ -2578,6 +2604,7 @@ conv_metaopt.register([local_abstractconv_gemm_alternative])
conv_metaopt
.
register
([
local_abstractconv_gemm_gradweights_alt
])
conv_metaopt
.
register
([
local_abstractconv_gradinputs_gemm_alt
])
conv_metaopt
.
register
([
local_abstractconv_cudnn_alternative
])
conv_metaopt
.
register
([
local_abstractconv3d2d
])
abstractconv_groupopt
.
register
(
'conv_metaopt'
,
conv_metaopt
,
'conv_meta'
,
position
=
0
)
# Register cuDNN batch normalization implementation
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论