Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
1f344114
提交
1f344114
authored
1月 21, 2010
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix gpu convop stuff since when we don't give the shape to ConvOp.
上级
a0bf5ef0
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
3 行删除
+12
-3
blas.py
theano/sandbox/cuda/blas.py
+8
-2
opt.py
theano/sandbox/cuda/opt.py
+4
-1
没有找到文件。
theano/sandbox/cuda/blas.py
浏览文件 @
1f344114
...
@@ -140,13 +140,15 @@ class GpuConv(Op):
...
@@ -140,13 +140,15 @@ class GpuConv(Op):
#TODO: reconsider this... since shapes are not given in constructor,
#TODO: reconsider this... since shapes are not given in constructor,
# maybe a multiplier + offset is a more appropriate way of passing this logical
# maybe a multiplier + offset is a more appropriate way of passing this logical
# grid
# grid
self
.
logical_img_hw
=
tuple
(
logical_img_hw
)
logical_img_hw
=
tuple
(
logical_img_hw
)
self
.
logical_img_hw
=
logical_img_hw
if
logical_kern_hw
is
not
None
:
if
logical_kern_hw
is
not
None
:
h
,
w
=
logical_kern_hw
h
,
w
=
logical_kern_hw
#TODO: reconsider this... since shapes are not given in constructor,
#TODO: reconsider this... since shapes are not given in constructor,
# maybe a multiplier + offset is a more appropriate way of passing this logical
# maybe a multiplier + offset is a more appropriate way of passing this logical
# grid
# grid
self
.
logical_kern_hw
=
tuple
(
logical_kern_hw
)
logical_kern_hw
=
tuple
(
logical_kern_hw
)
self
.
logical_kern_hw
=
logical_kern_hw
self
.
logical_kern_align_top
=
logical_kern_align_top
self
.
logical_kern_align_top
=
logical_kern_align_top
self
.
version
=
version
self
.
version
=
version
self
.
verbose
=
verbose
self
.
verbose
=
verbose
...
@@ -195,6 +197,8 @@ class GpuConv(Op):
...
@@ -195,6 +197,8 @@ class GpuConv(Op):
version
=
self
.
version
,
version
=
self
.
version
,
verbose
=
self
.
verbose
)
verbose
=
self
.
verbose
)
def
c_support_code_apply
(
self
,
node
,
nodename
):
def
c_support_code_apply
(
self
,
node
,
nodename
):
if
self
.
logical_img_hw
is
None
or
self
.
logical_kern_hw
is
None
:
return
super
(
GpuConv
,
self
)
.
c_support_code_apply
(
node
,
nodename
)
img_wid
=
self
.
logical_img_hw
[
1
]
img_wid
=
self
.
logical_img_hw
[
1
]
img_len
=
self
.
logical_img_hw
[
0
]
img_len
=
self
.
logical_img_hw
[
0
]
...
@@ -588,6 +592,8 @@ conv_full_patch_stack_padded( float* img, float* kern, float* out,
...
@@ -588,6 +592,8 @@ conv_full_patch_stack_padded( float* img, float* kern, float* out,
subsample_cols
=
self
.
subsample
[
1
]
subsample_cols
=
self
.
subsample
[
1
]
version
=
self
.
version
version
=
self
.
version
verbose
=
self
.
verbose
verbose
=
self
.
verbose
if
self
.
logical_img_hw
is
None
or
self
.
logical_kern_hw
is
None
:
return
super
(
GpuConv
,
self
)
.
c_code
(
node
,
nodename
,(
img
,
kern
),
(
out
,),
sub
)
#todo assert out is ccontiguous
#todo assert out is ccontiguous
img_wid
=
self
.
logical_img_hw
[
1
]
img_wid
=
self
.
logical_img_hw
[
1
]
img_len
=
self
.
logical_img_hw
[
0
]
img_len
=
self
.
logical_img_hw
[
0
]
...
...
theano/sandbox/cuda/opt.py
浏览文件 @
1f344114
...
@@ -339,9 +339,12 @@ def local_gpu_conv(node):
...
@@ -339,9 +339,12 @@ def local_gpu_conv(node):
conv(host_from_gpu) -> host_from_gpu(gpu_conv)
conv(host_from_gpu) -> host_from_gpu(gpu_conv)
"""
"""
def
GpuConvOp_from_ConvOp
(
op
):
def
GpuConvOp_from_ConvOp
(
op
):
logical_img_hw
=
None
if
op
.
imshp_logical
is
not
None
:
logical_img_hw
=
op
.
imshp_logical
[
1
:
3
]
ret
=
GpuConv
(
border_mode
=
op
.
out_mode
,
ret
=
GpuConv
(
border_mode
=
op
.
out_mode
,
subsample
=
(
op
.
dx
,
op
.
dy
),
subsample
=
(
op
.
dx
,
op
.
dy
),
logical_img_hw
=
op
.
imshp_logical
[
1
:
3
]
,
logical_img_hw
=
logical_img_hw
,
logical_kern_hw
=
op
.
kshp_logical
,
logical_kern_hw
=
op
.
kshp_logical
,
logical_kern_align_top
=
op
.
kshp_logical_top_aligned
,
logical_kern_align_top
=
op
.
kshp_logical_top_aligned
,
version
=
op
.
version
,
version
=
op
.
version
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论