Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
2e793229
提交
2e793229
authored
3月 29, 2016
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small import cleanup.
上级
ab833b19
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
7 行删除
+6
-7
elemwise.py
theano/sandbox/gpuarray/elemwise.py
+6
-7
没有找到文件。
theano/sandbox/gpuarray/elemwise.py
浏览文件 @
2e793229
...
...
@@ -4,8 +4,7 @@ from theano.compat import izip
import
numpy
import
theano
from
theano
import
Apply
,
scalar
,
config
from
theano
import
scalar
as
scal
from
theano
import
Apply
,
scalar
,
config
,
Op
from
six.moves
import
StringIO
,
xrange
from
theano.gof.utils
import
MethodNotDefined
from
theano.scalar
import
Scalar
...
...
@@ -585,7 +584,7 @@ class GpuCAReduceCuda(GpuKernelBase, HideC, CAReduceDtype):
This op was recently upgraded from just GpuSum a general CAReduce. Not
many code cases are supported for scalar_op being anything other than
scal.Add instances yet.
scal
ar
.Add instances yet.
Important note: if you implement new cases for this op, be sure to
benchmark them and make sure that they actually result in a speedup.
...
...
@@ -735,7 +734,7 @@ class GpuCAReduceCuda(GpuKernelBase, HideC, CAReduceDtype):
# It might be nice to use a property of the op class to do this,
# but tensor.elemwise.CAReduce has this exact same check so I guess
# this is OK to do
if
self
.
scalar_op
in
[
scal
.
minimum
,
scal
.
maximum
]:
if
self
.
scalar_op
in
[
scal
ar
.
minimum
,
scalar
.
maximum
]:
conds
=
[
"(PyGpuArray_DIMS(
%
s)[
%
d] == 0)"
%
(
x
,
i
)
for
i
in
xrange
(
nd_in
)
if
self
.
reduce_mask
[
i
]]
...
...
@@ -1060,13 +1059,13 @@ class GpuCAReduceCuda(GpuKernelBase, HideC, CAReduceDtype):
if
hasattr
(
self
.
scalar_op
,
'identity'
):
return
str
(
self
.
scalar_op
.
identity
)
else
:
assert
isinstance
(
self
.
scalar_op
,
(
scal
.
Maximum
,
scal
.
Minimum
))
assert
isinstance
(
self
.
scalar_op
,
(
scal
ar
.
Maximum
,
scal
ar
.
Minimum
))
if
self
.
pre_scalar_op
:
# TODO: multiple dtypes
# dtype = node.inputs[0].dtype
dtype
=
'float32'
dummy_var
=
scal
.
Scalar
(
dtype
=
dtype
)()
dummy_var
=
scal
ar
.
Scalar
(
dtype
=
dtype
)()
dummy_node
=
self
.
pre_scalar_op
.
make_node
(
dummy_var
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论