Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4cf0f055
提交
4cf0f055
authored
4月 04, 2014
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Elemwise.perform don't prealloc output as we don't use it!
上级
cf62c5c5
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
30 行增加
和
28 行删除
+30
-28
elemwise.py
theano/tensor/elemwise.py
+30
-28
没有找到文件。
theano/tensor/elemwise.py
浏览文件 @
4cf0f055
...
@@ -807,34 +807,36 @@ class Elemwise(OpenMPOp):
...
@@ -807,34 +807,36 @@ class Elemwise(OpenMPOp):
out_shape
.
append
(
max
(
values
))
out_shape
.
append
(
max
(
values
))
out_shape
=
tuple
(
out_shape
)
out_shape
=
tuple
(
out_shape
)
if
not
self
.
inplace_pattern
:
# Commented as we don't reuse outputs now.
for
output
,
storage
in
izip
(
node
.
outputs
,
output_storage
):
#
odat
=
storage
[
0
]
# if not self.inplace_pattern:
if
odat
is
not
None
:
# for output, storage in izip(node.outputs, output_storage):
if
odat
.
shape
!=
out_shape
:
# odat = storage[0]
# It is unsafe to try to resize odat,
# if odat is not None:
# we have to allocate output storage.
# if odat.shape != out_shape:
odat
=
None
# # It is unsafe to try to resize odat,
if
odat
is
None
:
# # we have to allocate output storage.
odat
=
numpy
.
ndarray
(
out_shape
,
dtype
=
output
.
type
.
dtype
)
# odat = None
storage
[
0
]
=
odat
# if odat is None:
else
:
# odat = numpy.ndarray(out_shape, dtype=output.type.dtype)
for
i
,
(
output
,
storage
)
in
enumerate
(
# storage[0] = odat
izip
(
node
.
outputs
,
output_storage
)):
# else:
#i is an output idx
# for i, (output, storage) in enumerate(
if
i
in
self
.
inplace_pattern
:
# izip(node.outputs, output_storage)):
odat
=
inputs
[
self
.
inplace_pattern
[
i
]]
# #i is an output idx
else
:
# if i in self.inplace_pattern:
odat
=
storage
[
0
]
# odat = inputs[self.inplace_pattern[i]]
if
odat
is
not
None
:
# else:
if
odat
.
shape
!=
out_shape
:
# odat = storage[0]
# It is unsafe to try to resize odat,
# if odat is not None:
# we have to allocate output storage.
# if odat.shape != out_shape:
odat
=
None
# # It is unsafe to try to resize odat,
if
odat
is
None
:
# # we have to allocate output storage.
odat
=
numpy
.
ndarray
(
out_shape
,
# odat = None
dtype
=
output
.
type
.
dtype
)
# if odat is None:
storage
[
0
]
=
odat
# odat = numpy.ndarray(out_shape,
# dtype=output.type.dtype)
# storage[0] = odat
ufunc_args
=
inputs
# + output_storage
ufunc_args
=
inputs
# + output_storage
if
self
.
nfunc
and
len
(
inputs
)
==
self
.
nfunc_spec
[
1
]:
if
self
.
nfunc
and
len
(
inputs
)
==
self
.
nfunc_spec
[
1
]:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论