Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
55a1fe82
提交
55a1fe82
authored
11月 26, 2014
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hack to lower the number of compilation on the GPU.
上级
01187ffe
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
16 行增加
和
4 行删除
+16
-4
cc.py
theano/gof/cc.py
+12
-2
dnn.py
theano/sandbox/cuda/dnn.py
+1
-0
type.py
theano/sandbox/cuda/type.py
+3
-2
没有找到文件。
theano/gof/cc.py
浏览文件 @
55a1fe82
...
@@ -342,8 +342,18 @@ def get_c_extract(r, name, sub):
...
@@ -342,8 +342,18 @@ def get_c_extract(r, name, sub):
"""Wrapper around c_extract that initializes py_name from storage."""
"""Wrapper around c_extract that initializes py_name from storage."""
if
any
([
getattr
(
c
.
op
,
'check_input'
,
config
.
check_input
)
for
(
c
,
_
)
in
if
any
([
getattr
(
c
.
op
,
'check_input'
,
config
.
check_input
)
for
(
c
,
_
)
in
r
.
clients
]):
r
.
clients
]):
# check_broadcast is just an hack to easily remove just the
c_extract
=
r
.
type
.
c_extract
(
name
,
sub
,
True
)
# broadcast check on the old GPU back-end. THis check isn't
# done in the new GPU back-end or on the CPU.
if
hasattr
(
c
.
op
,
'check_broadcast'
):
try
:
c_extract
=
r
.
type
.
c_extract
(
name
,
sub
,
True
,
check_broadcast
=
c
.
op
.
check_broadcast
)
except
TypeError
,
e
:
c_extract
=
r
.
type
.
c_extract
(
name
,
sub
,
True
)
else
:
c_extract
=
r
.
type
.
c_extract
(
name
,
sub
,
True
)
else
:
else
:
c_extract
=
r
.
type
.
c_extract
(
name
,
sub
,
False
)
c_extract
=
r
.
type
.
c_extract
(
name
,
sub
,
False
)
...
...
theano/sandbox/cuda/dnn.py
浏览文件 @
55a1fe82
...
@@ -244,6 +244,7 @@ class GpuDnnConvDesc(GpuOp):
...
@@ -244,6 +244,7 @@ class GpuDnnConvDesc(GpuOp):
class
GpuDnnConvBase
(
DnnBase
):
class
GpuDnnConvBase
(
DnnBase
):
__props__
=
()
__props__
=
()
check_broadcast
=
False
def
c_support_code_struct
(
self
,
node
,
struct_id
):
def
c_support_code_struct
(
self
,
node
,
struct_id
):
return
"""
return
"""
...
...
theano/sandbox/cuda/type.py
浏览文件 @
55a1fe82
...
@@ -280,7 +280,8 @@ class CudaNdarrayType(Type):
...
@@ -280,7 +280,8 @@ class CudaNdarrayType(Type):
def
c_init
(
self
,
name
,
sub
):
def
c_init
(
self
,
name
,
sub
):
return
"
%(name)
s = NULL;"
%
locals
()
return
"
%(name)
s = NULL;"
%
locals
()
def
c_extract
(
self
,
name
,
sub
,
check_input
=
True
):
def
c_extract
(
self
,
name
,
sub
,
check_input
=
True
,
check_broadcast
=
True
):
sio
=
StringIO
()
sio
=
StringIO
()
fail
=
sub
[
'fail'
]
fail
=
sub
[
'fail'
]
nd
=
self
.
ndim
nd
=
self
.
ndim
...
@@ -307,7 +308,7 @@ class CudaNdarrayType(Type):
...
@@ -307,7 +308,7 @@ class CudaNdarrayType(Type):
//std::cerr << "c_extract " <<
%(name)
s << " nd check passed
\\
n";
//std::cerr << "c_extract " <<
%(name)
s << " nd check passed
\\
n";
"""
%
locals
()
"""
%
locals
()
for
i
,
b
in
enumerate
(
self
.
broadcastable
):
for
i
,
b
in
enumerate
(
self
.
broadcastable
):
if
b
:
if
b
and
check_broadcast
:
print
>>
sio
,
"""
print
>>
sio
,
"""
if (CudaNdarray_HOST_DIMS(
%(name)
s)[
%(i)
s] != 1)
if (CudaNdarray_HOST_DIMS(
%(name)
s)[
%(i)
s] != 1)
{
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论