Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
30126992
提交
30126992
authored
4月 29, 2010
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
gof/cc - added code to handle non-hashable constant signatures by returning a
Null key. This can happen for constants with type 'generic'.
上级
695bcad0
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
16 行增加
和
2 行删除
+16
-2
cc.py
theano/gof/cc.py
+16
-2
没有找到文件。
theano/gof/cc.py
浏览文件 @
30126992
...
@@ -858,6 +858,7 @@ class CLinker(link.Linker):
...
@@ -858,6 +858,7 @@ class CLinker(link.Linker):
if
config
.
gcc
.
cxxflags
:
if
config
.
gcc
.
cxxflags
:
sig
.
append
(
config
.
gcc
.
cxxflags
)
sig
.
append
(
config
.
gcc
.
cxxflags
)
error_on_play
=
[
False
]
def
in_sig
(
i
,
topological_pos
,
i_idx
):
def
in_sig
(
i
,
topological_pos
,
i_idx
):
# assert that every input to every node is one of'
# assert that every input to every node is one of'
# - an env input
# - an env input
...
@@ -868,8 +869,15 @@ class CLinker(link.Linker):
...
@@ -868,8 +869,15 @@ class CLinker(link.Linker):
# yield a 'position' that reflects its role in code_gen()
# yield a 'position' that reflects its role in code_gen()
if
isinstance
(
i
,
graph
.
Constant
):
#orphans
if
isinstance
(
i
,
graph
.
Constant
):
#orphans
if
id
(
i
)
not
in
constant_ids
:
if
id
(
i
)
not
in
constant_ids
:
constant_ids
[
id
(
i
)]
=
(
i
.
signature
(),
topological_pos
,
i_idx
)
isig
=
(
i
.
signature
(),
topological_pos
,
i_idx
)
isig
=
constant_ids
[
id
(
i
)]
try
:
hash
(
isig
)
except
:
#generic constants don't have a hashable signature
error_on_play
[
0
]
=
True
return
None
constant_ids
[
id
(
i
)]
=
isig
else
:
isig
=
constant_ids
[
id
(
i
)]
#print 'SIGNATURE', i.signature()
#print 'SIGNATURE', i.signature()
#return i.signature()
#return i.signature()
elif
i
in
env_inputs_dict
:
#inputs
elif
i
in
env_inputs_dict
:
#inputs
...
@@ -903,6 +911,12 @@ class CLinker(link.Linker):
...
@@ -903,6 +911,12 @@ class CLinker(link.Linker):
for
ipos
,
i
in
enumerate
(
node
.
inputs
)),
for
ipos
,
i
in
enumerate
(
node
.
inputs
)),
tuple
(
o
in
no_recycling
for
o
in
node
.
outputs
)))
tuple
(
o
in
no_recycling
for
o
in
node
.
outputs
)))
if
error_on_play
[
0
]:
# if one of the signatures is not hashable
# then bypass the cache mechanism and
# compile fresh every time
return
None
op_pos
[
node
]
=
node_pos
op_pos
[
node
]
=
node_pos
env_computed_set
.
update
(
node
.
outputs
)
env_computed_set
.
update
(
node
.
outputs
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论