Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c2d3c959
提交
c2d3c959
authored
8月 07, 2017
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make Theano forward compatible in case we change the hash name string in the key.
上级
dc4d77ed
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
21 行增加
和
11 行删除
+21
-11
cmodule.py
theano/gof/cmodule.py
+21
-11
没有找到文件。
theano/gof/cmodule.py
浏览文件 @
c2d3c959
...
@@ -415,11 +415,13 @@ def get_module_hash(src_code, key):
...
@@ -415,11 +415,13 @@ def get_module_hash(src_code, key):
# libraries to link against.
# libraries to link against.
to_hash
+=
list
(
key_element
)
to_hash
+=
list
(
key_element
)
elif
isinstance
(
key_element
,
string_types
):
elif
isinstance
(
key_element
,
string_types
):
if
key_element
.
startswith
(
'md5:'
):
if
(
key_element
.
startswith
(
'md5:'
)
or
key_element
.
startswith
(
'sha256:'
)
or
key_element
.
startswith
(
'hash:'
)):
# This is actually a sha256 hash of the config options.
# This is actually a sha256 hash of the config options.
#
Ref PR#5916. String and function names will be updated in
#
Currently, we still keep md5 to don't break old Theano.
#
future release.
#
We add 'sha256:' and 'hash:' so that when we change it in
#
We can stop here
.
#
the futur, it won't break this version of Theano
.
break
break
elif
(
key_element
.
startswith
(
'NPY_ABI_VERSION=0x'
)
or
elif
(
key_element
.
startswith
(
'NPY_ABI_VERSION=0x'
)
or
key_element
.
startswith
(
'c_compiler_str='
)):
key_element
.
startswith
(
'c_compiler_str='
)):
...
@@ -448,20 +450,28 @@ def get_safe_part(key):
...
@@ -448,20 +450,28 @@ def get_safe_part(key):
# This function should only be called on versioned keys.
# This function should only be called on versioned keys.
assert
version
assert
version
# Find the hash part, which is using sha256, not md5.
# Find the hash part. This is actually a sha256 hash of the config
# Instances of md5 will be replaced in future release.
# options. Currently, we still keep md5 to don't break old
# Theano. We add 'sha256:' and 'hash:' so that when we change it
# in the futur, it won't break this version of Theano.
c_link_key
=
key
[
1
]
c_link_key
=
key
[
1
]
# In case in the future, we don't have an md5 part and we have
# In case in the future, we don't have an md5 part and we have
# such stuff in the cache. In that case, we can set None, and the
# such stuff in the cache. In that case, we can set None, and the
# rest of the cache mechanism will just skip that key.
# rest of the cache mechanism will just skip that key.
md5
=
None
hash
=
None
for
key_element
in
c_link_key
[
1
:]:
for
key_element
in
c_link_key
[
1
:]:
if
(
isinstance
(
key_element
,
string_types
)
and
if
isinstance
(
key_element
,
string_types
):
key_element
.
startswith
(
'md5:'
)):
if
key_element
.
startswith
(
'md5:'
):
md5
=
key_element
[
4
:]
hash
=
key_element
[
4
:]
break
elif
key_element
.
startswith
(
'sha256:'
):
hash
=
key_element
[
7
:]
break
elif
key_element
.
startswith
(
'hash:'
):
hash
=
key_element
[
5
:]
break
break
return
key
[
0
]
+
(
md5
,
)
return
key
[
0
]
+
(
hash
,
)
class
KeyData
(
object
):
class
KeyData
(
object
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论