Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d2240bdd
提交
d2240bdd
authored
3月 29, 2012
作者:
Olivier Delalleau
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #574 from nouiz/gpu_setsubtensor
Gpu setsubtensor
上级
de717450
6872ae43
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
35 行增加
和
5 行删除
+35
-5
opt.py
theano/sandbox/cuda/opt.py
+32
-4
test_basic_ops.py
theano/sandbox/cuda/tests/test_basic_ops.py
+3
-1
test_basic.py
theano/tensor/tests/test_basic.py
+0
-0
没有找到文件。
theano/sandbox/cuda/opt.py
浏览文件 @
d2240bdd
...
...
@@ -2,6 +2,7 @@ import logging
_logger
=
logging
.
getLogger
(
'theano.sandbox.cuda.opt'
)
import
sys
import
warnings
import
numpy
...
...
@@ -747,8 +748,22 @@ def local_gpu_advanced_incsubtensor1(node):
host_input
.
owner
.
op
.
__class__
is
tensor
.
AdvancedIncSubtensor1
:
x
,
y
=
host_input
.
owner
.
inputs
[
0
:
2
]
coords
=
host_input
.
owner
.
inputs
[
2
:]
return
[
GpuAdvancedIncSubtensor1
()(
gpu_from_host
(
x
),
gpu_from_host
(
y
),
*
coords
)]
set_instead_of_inc
=
host_input
.
owner
.
op
.
set_instead_of_inc
if
set_instead_of_inc
and
config
.
warn
.
gpu_set_subtensor1
:
warnings
.
warn
(
'Although your current code is fine, please note that '
'Theano versions prior to 0.6 (more specifically, '
'prior to commit XXXX on DATE) may have '
'yielded an incorrect result. To remove this warning, '
'either set the `warn.gpu_set_subtensor1` config '
'option to False, or `warn.ignore_bug_before` to at '
'least
\'
0.6
\'
.'
)
if
set_instead_of_inc
:
return
gpu_op
=
GpuAdvancedIncSubtensor1
(
set_instead_of_inc
=
set_instead_of_inc
)
return
[
gpu_op
(
gpu_from_host
(
x
),
gpu_from_host
(
y
),
*
coords
)]
# Should not execute for GpuAdvancedIncSubtensor1
if
node
.
op
.
__class__
is
tensor
.
AdvancedIncSubtensor1
and
\
...
...
@@ -767,8 +782,21 @@ def local_gpu_advanced_incsubtensor1(node):
else
:
gpu_y
=
gpu_from_host
(
y
)
if
go_gpu
:
return
[
host_from_gpu
(
GpuAdvancedIncSubtensor1
()(
gpu_x
,
gpu_y
,
*
coords
))]
set_instead_of_inc
=
node
.
op
.
set_instead_of_inc
if
set_instead_of_inc
and
config
.
warn
.
gpu_set_subtensor1
:
warnings
.
warn
(
'Although your current code is fine, please note that '
'Theano versions prior to 0.6 (more specifically, '
'prior to commit XXXX on DATE) may have '
'yielded an incorrect result. To remove this warning, '
'either set the `warn.gpu_set_subtensor1` config '
'option to False, or `warn.ignore_bug_before` to at '
'least
\'
0.6
\'
.'
,
stacklevel
=
1
)
if
set_instead_of_inc
:
return
gpu_op
=
GpuAdvancedIncSubtensor1
(
set_instead_of_inc
=
set_instead_of_inc
)
return
[
host_from_gpu
(
gpu_op
(
gpu_x
,
gpu_y
,
*
coords
))]
return
False
...
...
theano/sandbox/cuda/tests/test_basic_ops.py
浏览文件 @
d2240bdd
...
...
@@ -887,7 +887,9 @@ class T_subtensor(theano.tensor.tests.test_basic.T_subtensor):
mode
=
mode_with_gpu
dtype
=
'float32'
ignore_topo
=
(
B
.
HostFromGpu
,
B
.
GpuFromHost
)
fast_compile
=
theano
.
config
.
mode
==
'FAST_COMPILE'
fast_compile
=
False
ops
=
(
cuda
.
GpuSubtensor
,
cuda
.
GpuIncSubtensor
,
cuda
.
GpuAdvancedSubtensor1
,
cuda
.
GpuAdvancedIncSubtensor1
)
def
__init__
(
self
,
name
):
return
super
(
theano
.
tensor
.
tests
.
test_basic
.
T_subtensor
,
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
d2240bdd
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论