Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5a34781f
提交
5a34781f
authored
3月 22, 2012
作者:
nouiz
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #559 from delallea/concat_rebroadcast_fix
Fixed crash in a specific concatenate situation
上级
87c38921
40ba569b
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
2 行删除
+17
-2
NEWS.txt
NEWS.txt
+2
-0
opt.py
theano/tensor/opt.py
+6
-2
test_basic.py
theano/tensor/tests/test_basic.py
+9
-0
没有找到文件。
NEWS.txt
浏览文件 @
5a34781f
...
...
@@ -79,6 +79,8 @@ Crash Fix
(Pascal L., reported by Simon McGregor)
* Fixed issue with the MaxAndArgmax Op not properly preserving broadcastable
dimensions, which could typically result in optimization crashes (Olivier D.)
* Fixed crash when concatenating some arrays with specific broadcasting
patterns (Olivier D.)
=============
Release Notes
...
...
theano/tensor/opt.py
浏览文件 @
5a34781f
...
...
@@ -2078,7 +2078,11 @@ def local_rebroadcast_lift(node):
input
=
node
.
inputs
[
0
]
inode
=
input
.
owner
if
inode
and
isinstance
(
inode
.
op
,
Elemwise
)
and
len
(
inode
.
inputs
)
==
1
:
if
len
(
input
.
clients
)
==
1
:
# It may happen that `input` has no client because this optimization
# is called from `apply_rebroadcast_opt`, which in particular is used
# by the `unbroadcast` function before we are in the actual function
# compilation phase.
if
hasattr
(
input
,
'clients'
)
and
len
(
input
.
clients
)
==
1
:
rval
=
inode
.
op
.
make_node
(
T
.
Rebroadcast
(
*
op
.
axis
.
items
())(
inode
.
inputs
[
0
]))
.
outputs
return
rval
...
...
@@ -2098,7 +2102,7 @@ def apply_rebroadcast_opt(rval):
and local_rebroadcast_lift.
:param rval: a Variable
:ret
run: a Variable. The same if not optimisation can be applied.
:ret
urn: a Variable (the same if no optimization can be applied)
"""
changed
=
True
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
5a34781f
...
...
@@ -3387,6 +3387,15 @@ class T_Join_and_Split(unittest.TestCase):
else
:
f
(
get_mat
(
3
,
4
),
get_mat
(
3
,
4
),
get_mat
(
2
,
5
))
def
test_rebroadcast
(
self
):
"""
Regression test for a crash that used to happen when rebroadcasting.
"""
x
=
tensor
.
TensorType
(
floatX
,
[
False
,
False
,
True
])()
u
=
tensor
.
TensorType
(
floatX
,
[
False
,
False
,
True
])()
# This line used to crash.
z
=
tensor
.
concatenate
([
x
,
-
u
],
axis
=
2
)
class
test_comparison
(
unittest
.
TestCase
):
def
test_gt
(
self
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论