Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
44480978
提交
44480978
authored
6月 22, 2016
作者:
sentient07
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed the unnecessary print statements and added missing documentation
上级
8ea065e6
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
24 行增加
和
11 行删除
+24
-11
dnn.py
theano/gpuarray/dnn.py
+5
-3
opt.py
theano/gpuarray/opt.py
+19
-8
没有找到文件。
theano/gpuarray/dnn.py
浏览文件 @
44480978
...
...
@@ -26,7 +26,7 @@ from . import pygpu
from
.type
import
get_context
,
gpu_context_type
,
list_contexts
from
.basic_ops
import
(
as_gpuarray_variable
,
infer_context_name
,
gpu_contiguous
,
gpu_alloc_empty
,
empty_like
)
empty_like
,
GpuArrayType
)
from
.elemwise
import
GpuElemwise
# These don't exist in gpuarray
...
...
@@ -1438,8 +1438,8 @@ def local_abstractconv_cudnn_graph(op, context_name, inputs, outputs):
if
(
op
.
filter_dilation
!=
(
1
,
1
)):
return
None
inp1
=
as_gpuarray_variable
(
inputs
[
0
],
context_name
)
inp2
=
as_gpuarray_variable
(
inputs
[
1
],
context_name
)
inp1
=
inputs
[
0
]
inp2
=
inputs
[
1
]
if
not
dnn_available
(
inp1
.
type
.
context_name
):
raise_no_cudnn
()
...
...
@@ -1476,6 +1476,8 @@ def local_abstractconv_cudnn_graph(op, context_name, inputs, outputs):
AbstractConv2d_gradInputs
])
def
local_abstractconv_cudnn
(
node
):
ctx
=
infer_context_name
(
*
node
.
inputs
)
if
not
isinstance
(
node
.
inputs
[
0
]
.
type
,
GpuArrayType
):
return
return
local_abstractconv_cudnn_graph
(
node
.
op
,
ctx
,
node
.
inputs
,
node
.
outputs
)
conv_groupopt
.
register
(
'local_abstractconv_cudnn_graph'
,
...
...
theano/gpuarray/opt.py
浏览文件 @
44480978
...
...
@@ -30,7 +30,7 @@ from theano.tensor.nnet.abstract_conv import (AbstractConv2d,
from
theano.tests.breakpoint
import
PdbBreakpoint
from
.type
import
(
GpuArrayType
,
GpuArrayConstant
,
get_context
,
ContextNotDefined
)
ContextNotDefined
,
GpuArraySharedVariable
,
GpuArrayVariable
)
from
.basic_ops
import
(
as_gpuarray_variable
,
infer_context_name
,
host_from_gpu
,
GpuToGpu
,
HostFromGpu
,
GpuFromHost
,
...
...
@@ -107,6 +107,19 @@ def register_opt(*tags, **kwargs):
def
register_opt2
(
tracks
,
*
tags
,
**
kwargs
):
'''
Decorator for the new GraphToGPU optimizer.
Takes an extra parameter(Op) compared to register_opt decorator.
Parameters
----------
tracks : Op
The Node's Op to which optimization is being applied.
tags : String
The tag optimization mode to which the optimizer will be registered.
'''
def
f
(
local_opt
):
name
=
(
kwargs
and
kwargs
.
pop
(
'name'
))
or
local_opt
.
__name__
opt
=
theano
.
gof
.
local_optimizer
(
tracks
)(
local_opt
)
...
...
@@ -315,7 +328,12 @@ 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
):
...
...
@@ -416,13 +434,6 @@ class GraphToGPU(NavigatorOptimizer):
not_used
=
[]
not_used_time
=
0
for
s
in
list
(
set
(
old_not_transferred
)):
print
(
blanc
,
'Nodes not transferred by old opt : '
+
str
(
s
),
file
=
stream
)
for
n
in
list
(
set
(
new_not_transferred
)):
print
(
blanc
,
'Nodes not transferred by new optimizer : '
+
str
(
n
),
file
=
stream
)
for
d
in
list
(
set
(
set
(
new_not_transferred
)
-
set
(
old_not_transferred
))):
print
(
blanc
,
'Not transferred difference : '
,
str
(
d
),
file
=
stream
)
for
o
,
count
in
iteritems
(
process_count
):
if
count
>
0
:
count_opt
.
append
((
time_opts
[
o
],
count
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论