Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
8ff8eb32
提交
8ff8eb32
authored
3月 06, 2018
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Handle acc_dtype correclty in GpuDnnReduction optimizer.
上级
d1407834
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
7 行增加
和
9 行删除
+7
-9
dnn.py
theano/gpuarray/dnn.py
+7
-9
没有找到文件。
theano/gpuarray/dnn.py
浏览文件 @
8ff8eb32
...
@@ -3729,27 +3729,26 @@ def local_dnn_reduction(node):
...
@@ -3729,27 +3729,26 @@ def local_dnn_reduction(node):
if
node
.
inputs
[
0
]
.
ndim
>
8
:
if
node
.
inputs
[
0
]
.
ndim
>
8
:
return
return
acc_dtype
=
node
.
op
.
_acc_dtype
(
node
.
inputs
[
0
]
.
dtype
)
if
node
.
inputs
[
0
]
.
dtype
!=
node
.
outputs
[
0
]
.
dtype
:
if
node
.
inputs
[
0
]
.
dtype
!=
node
.
outputs
[
0
]
.
dtype
:
# We can mix float16 and float32, but not float64.
# We can mix float16 and float32, but not float64.
if
(
node
.
inputs
[
0
]
.
dtype
==
'float64'
or
if
(
node
.
inputs
[
0
]
.
dtype
==
'float64'
or
node
.
outputs
[
0
]
.
dtype
==
'float64'
):
node
.
outputs
[
0
]
.
dtype
==
'float64'
):
return
return
if
node
.
op
.
acc_dtype
!=
'float32'
:
if
acc_dtype
!=
'float32'
:
return
return
if
node
.
inputs
[
0
]
.
dtype
not
in
[
'float16'
,
'float32'
,
'float64'
]:
if
node
.
inputs
[
0
]
.
dtype
not
in
[
'float16'
,
'float32'
,
'float64'
]:
return
return
if
(
node
.
inputs
[
0
]
.
dtype
==
'float64'
and
if
(
node
.
inputs
[
0
]
.
dtype
==
'float64'
and
acc_dtype
!=
'float64'
):
node
.
op
.
acc_dtype
!=
'float64'
):
return
return
if
(
node
.
inputs
[
0
]
.
dtype
==
'float32'
and
if
(
node
.
inputs
[
0
]
.
dtype
==
'float32'
and
acc_dtype
!=
'float32'
):
node
.
op
.
acc_dtype
!=
'float32'
):
return
return
if
(
node
.
inputs
[
0
]
.
dtype
==
'float16'
and
if
(
node
.
inputs
[
0
]
.
dtype
==
'float16'
and
acc_dtype
==
'float64'
):
node
.
op
.
acc_dtype
==
'float64'
):
return
return
def
_identity
(
a
):
def
_identity
(
a
):
...
@@ -3762,7 +3761,6 @@ def local_dnn_reduction(node):
...
@@ -3762,7 +3761,6 @@ def local_dnn_reduction(node):
post
=
_identity
post
=
_identity
if
node
.
op
.
pre_scalar_op
is
not
None
:
if
node
.
op
.
pre_scalar_op
is
not
None
:
# Might want to handle absmax, avg, and other cases for (norm1, norm2) here
if
isinstance
(
node
.
op
.
scalar_op
,
theano
.
scalar
.
basic
.
Add
):
if
isinstance
(
node
.
op
.
scalar_op
,
theano
.
scalar
.
basic
.
Add
):
if
isinstance
(
node
.
op
.
pre_scalar_op
,
theano
.
scalar
.
basic
.
Sqr
):
if
isinstance
(
node
.
op
.
pre_scalar_op
,
theano
.
scalar
.
basic
.
Sqr
):
scal
=
'norm2'
scal
=
'norm2'
...
@@ -3783,7 +3781,7 @@ def local_dnn_reduction(node):
...
@@ -3783,7 +3781,7 @@ def local_dnn_reduction(node):
with
inherit_stack_trace
(
node
.
outputs
):
with
inherit_stack_trace
(
node
.
outputs
):
ret
=
GpuDnnReduction
(
scal
,
ret
=
GpuDnnReduction
(
scal
,
node
.
op
.
axis
,
node
.
op
.
axis
,
node
.
op
.
_acc_dtype
(
node
.
inputs
[
0
]
.
dtype
)
,
acc_dtype
,
node
.
op
.
dtype
,
node
.
op
.
dtype
,
False
)(
node
.
inputs
[
0
])
False
)(
node
.
inputs
[
0
])
return
[
post
(
ret
)]
return
[
post
(
ret
)]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论