Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0797283e
提交
0797283e
authored
7月 07, 2016
作者:
sentient07
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Final Cleanup
上级
6548ed04
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
11 行删除
+6
-11
opt.py
theano/gpuarray/opt.py
+6
-11
没有找到文件。
theano/gpuarray/opt.py
浏览文件 @
0797283e
...
...
@@ -314,9 +314,9 @@ class GraphToGPU(NavigatorOptimizer):
for
lopt
in
(
self
.
local_optimizers_map
.
get
(
node
.
op
,
[])
+
self
.
local_optimizers_map
.
get
(
type
(
node
.
op
),
[])
+
self
.
local_optimizers_all
):
process_count
.
setdefault
(
lopt
,
0
)
time_opts
.
setdefault
(
lopt
,
0
)
node_created
.
setdefault
(
lopt
,
0
)
process_count
.
setdefault
(
lopt
,
0
)
time_opts
.
setdefault
(
lopt
,
0
)
node_created
.
setdefault
(
lopt
,
0
)
for
node
in
topo
:
...
...
@@ -326,12 +326,7 @@ class GraphToGPU(NavigatorOptimizer):
# Move only if any of the inputs are on the GPU.
move_to_GPU
=
False
if
any
([
isinstance
(
i
,
GpuArrayVariable
)
or
isinstance
(
i
,
GpuArraySharedVariable
)
for
i
in
[
mapping
[
v
]
for
v
in
node
.
inputs
]
+
node
.
outputs
]):
move_to_GPU
=
True
context_name
=
None
for
i
in
[
mapping
[
i
]
for
i
in
node
.
inputs
]:
if
isinstance
(
i
.
type
,
GpuArrayType
):
...
...
@@ -754,7 +749,7 @@ def local_gpua_dimshuffle(op, context_name, inputs, outputs):
@register_opt
(
'fast_compile'
)
@op_lifter
([
tensor
.
SpecifyShape
])
#
@register_opt2([tensor.SpecifyShape], 'fast_compile')
@register_opt2
([
tensor
.
SpecifyShape
],
'fast_compile'
)
def
local_gpua_specifyShape
(
op
,
context_name
,
inputs
,
outputs
):
if
isinstance
(
inputs
[
0
]
.
type
,
GpuArrayType
):
return
...
...
@@ -1198,7 +1193,7 @@ def local_gpua_dot22scalar(op, context_name, inputs, outputs):
@op_lifter
([
tensor
.
basic
.
Eye
])
@register_opt2
([
tensor
.
basic
.
Eye
],
'fast_compile'
)
def
local_gpua_eye
(
op
,
context_name
,
inputs
,
outputs
):
return
[
GpuEye
(
dtype
=
op
.
dtype
,
context_name
=
context_name
)(
*
inputs
)]
return
GpuEye
(
dtype
=
op
.
dtype
,
context_name
=
context_name
)(
*
inputs
)
@register_opt
(
'fast_compile'
)
...
...
@@ -1298,7 +1293,7 @@ def local_lift_abstractconv2d(op, context_name, inputs, outputs):
if
isinstance
(
outputs
[
0
]
.
type
,
GpuArrayType
):
# Don't handle this node here, it's already on the GPU.
return
local_lift_abstractconv2d_graph
(
op
,
context_name
,
inputs
,
outputs
)
return
local_lift_abstractconv2d_graph
(
op
,
context_name
,
inputs
,
outputs
)
@register_opt2
([
AbstractConv2d
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论