Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
17b360f2
提交
17b360f2
authored
6月 03, 2015
作者:
--global
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix Cuda optimization for PdbBreakpoint
上级
15f30cda
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
8 行增加
和
13 行删除
+8
-13
opt.py
theano/sandbox/cuda/opt.py
+8
-13
没有找到文件。
theano/sandbox/cuda/opt.py
浏览文件 @
17b360f2
...
...
@@ -1153,8 +1153,9 @@ def local_gpu_pdbbreakpoint_op(node):
new_inputs
=
node
.
inputs
[:
1
]
input_transfered
=
[]
# Propagate the transfers to gpu through the PdbBreakpoint node
# while leaving the PdbBreakpoint node fully on the host
# Go through the monitored variables, only transfering on GPU those
# for which the input comes from the GPU or the output will be
# transfered on the GPU.
nb_monitored_vars
=
len
(
node
.
outputs
)
for
i
in
range
(
nb_monitored_vars
):
...
...
@@ -1163,23 +1164,22 @@ def local_gpu_pdbbreakpoint_op(node):
input_is_from_gpu
=
(
inp
.
owner
and
isinstance
(
inp
.
owner
.
op
,
HostFromGpu
))
output_used
=
len
(
out
.
clients
)
>
0
output_goes_to_gpu
=
all
([
c
[
0
]
!=
"output"
and
output_goes_to_gpu
=
any
([
c
[
0
]
!=
"output"
and
isinstance
(
c
[
0
]
.
op
,
GpuFromHost
)
for
c
in
out
.
clients
])
if
input_is_from_gpu
and
output_used
and
not
output_goes_to_gpu
:
if
input_is_from_gpu
:
# The op should be applied on the GPU version of the input
new_inputs
.
append
(
inp
.
owner
.
inputs
[
0
])
input_transfered
.
append
(
True
)
elif
not
input_is_from_gpu
and
output_used
and
output_goes_to_gpu
:
elif
output_goes_to_gpu
:
# The input should be transfered to the gpu
new_inputs
.
append
(
gpu_from_host
(
inp
))
input_transfered
.
append
(
True
)
else
:
#
Both are on the gpu or on the host.
No transfer is required.
# No transfer is required.
new_inputs
.
append
(
inp
)
input_transfered
.
append
(
False
)
...
...
@@ -1189,12 +1189,7 @@ def local_gpu_pdbbreakpoint_op(node):
return
False
# Apply the op on the new inputs
new_op_outputs
=
node
.
op
(
*
new_inputs
)
# Ensure that new_op_outputs is a list of outputs (in case the op has
# only one output)
if
not
isinstance
(
new_op_outputs
,
list
):
new_op_outputs
=
[
new_op_outputs
]
new_op_outputs
=
node
.
op
(
*
new_inputs
,
return_list
=
True
)
# Propagate the transfer to the gpu through the outputs that require
# it
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论