Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
650934ae
提交
650934ae
authored
8月 07, 2017
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small modif following code review
上级
8f43baf5
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
3 行增加
和
7 行删除
+3
-7
cmodule.py
theano/gof/cmodule.py
+3
-7
没有找到文件。
theano/gof/cmodule.py
浏览文件 @
650934ae
...
@@ -377,7 +377,7 @@ def is_same_entry(entry_1, entry_2):
...
@@ -377,7 +377,7 @@ def is_same_entry(entry_1, entry_2):
def
get_module_hash
(
src_code
,
key
):
def
get_module_hash
(
src_code
,
key
):
"""
"""
Return a SHA256
(for FIPS compatibility)
hash that uniquely identifies a module.
Return a SHA256 hash that uniquely identifies a module.
This hash takes into account:
This hash takes into account:
1. The C source code of the module (`src_code`).
1. The C source code of the module (`src_code`).
...
@@ -416,11 +416,10 @@ def get_module_hash(src_code, key):
...
@@ -416,11 +416,10 @@ def get_module_hash(src_code, key):
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:'
)
or
if
(
key_element
.
startswith
(
'md5:'
)
or
key_element
.
startswith
(
'sha256:'
)
or
key_element
.
startswith
(
'hash:'
)):
key_element
.
startswith
(
'hash:'
)):
# This is actually a sha256 hash of the config options.
# This is actually a sha256 hash of the config options.
# Currently, we still keep md5 to don't break old Theano.
# Currently, we still keep md5 to don't break old Theano.
# We add '
sha256:' and '
hash:' so that when we change it in
# We add 'hash:' so that when we change it in
# the futur, it won't break this version of Theano.
# 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
...
@@ -452,7 +451,7 @@ def get_safe_part(key):
...
@@ -452,7 +451,7 @@ def get_safe_part(key):
# Find the hash part. This is actually a sha256 hash of the config
# Find the hash part. This is actually a sha256 hash of the config
# options. Currently, we still keep md5 to don't break old
# options. Currently, we still keep md5 to don't break old
# Theano. We add '
sha256:' and '
hash:' so that when we change it
# Theano. We add 'hash:' so that when we change it
# in the futur, it won't break this version of Theano.
# 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
...
@@ -464,9 +463,6 @@ def get_safe_part(key):
...
@@ -464,9 +463,6 @@ def get_safe_part(key):
if
key_element
.
startswith
(
'md5:'
):
if
key_element
.
startswith
(
'md5:'
):
hash
=
key_element
[
4
:]
hash
=
key_element
[
4
:]
break
break
elif
key_element
.
startswith
(
'sha256:'
):
hash
=
key_element
[
7
:]
break
elif
key_element
.
startswith
(
'hash:'
):
elif
key_element
.
startswith
(
'hash:'
):
hash
=
key_element
[
5
:]
hash
=
key_element
[
5
:]
break
break
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论