Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
59f42d11
提交
59f42d11
authored
8月 07, 2017
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
flake8
上级
052588b9
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
17 行增加
和
17 行删除
+17
-17
configparser.py
theano/configparser.py
+5
-5
cc.py
theano/gof/cc.py
+5
-5
cmodule.py
theano/gof/cmodule.py
+5
-5
utils.py
theano/tensor/utils.py
+2
-2
没有找到文件。
theano/configparser.py
浏览文件 @
59f42d11
...
@@ -186,11 +186,11 @@ def _config_print(thing, buf, print_doc=True):
...
@@ -186,11 +186,11 @@ def _config_print(thing, buf, print_doc=True):
def
get_config_md5
():
def
get_config_md5
():
"""
"""
Return a string sha256 of the current config options. hash_from_code uses
Return a string sha256 of the current config options. hash_from_code uses
sha256, and not md5. Updated in PR#5916. Function names will be properly
sha256, and not md5. Updated in PR#5916. Function names will be properly
updated in future release.
updated in future release.
The string should be such that we can safely assume that two different
The string should be such that we can safely assume that two different
config setups will lead to two different strings.
config setups will lead to two different strings.
We only take into account config options for which `in_c_key` is True.
We only take into account config options for which `in_c_key` is True.
"""
"""
...
...
theano/gof/cc.py
浏览文件 @
59f42d11
...
@@ -1229,16 +1229,16 @@ class CLinker(link.Linker):
...
@@ -1229,16 +1229,16 @@ class CLinker(link.Linker):
The signature has the following form:
The signature has the following form:
{{{
{{{
'CLinker.cmodule_key', compilation args, libraries,
'CLinker.cmodule_key', compilation args, libraries,
header_dirs, numpy ABI version, config
md5
,
header_dirs, numpy ABI version, config
hash
,
(op0, input_signature0, output_signature0),
(op0, input_signature0, output_signature0),
(op1, input_signature1, output_signature1),
(op1, input_signature1, output_signature1),
...
...
(opK, input_signatureK, output_signatureK),
(opK, input_signatureK, output_signatureK),
}}}
}}}
Note that config md5
uses sha256, and not md5. Function names will
Note that config hash now
uses sha256, and not md5. Function names will
updated in a future release to reflect the use of hashlib.sha256.
updated in a future release to reflect the use of hashlib.sha256.
The signature is a tuple, some elements of which are sub-tuples.
The signature is a tuple, some elements of which are sub-tuples.
The outer tuple has a brief header, containing the compilation options
The outer tuple has a brief header, containing the compilation options
...
@@ -1350,7 +1350,7 @@ class CLinker(link.Linker):
...
@@ -1350,7 +1350,7 @@ class CLinker(link.Linker):
constant_ids
=
dict
()
constant_ids
=
dict
()
op_pos
=
{}
# Apply -> topological position
op_pos
=
{}
# Apply -> topological position
# First we put the header, compile_args, library names and config
md5
# First we put the header, compile_args, library names and config
hash
# into the signature.
# into the signature.
sig
=
[
'CLinker.cmodule_key'
]
# will be cast to tuple on return
sig
=
[
'CLinker.cmodule_key'
]
# will be cast to tuple on return
if
compile_args
is
not
None
:
if
compile_args
is
not
None
:
...
...
theano/gof/cmodule.py
浏览文件 @
59f42d11
...
@@ -416,10 +416,10 @@ def get_module_hash(src_code, key):
...
@@ -416,10 +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:'
):
if
key_element
.
startswith
(
'md5:'
):
# 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
# Ref PR#5916. String and function names will be updated in
# future release.
# future release.
# We can stop here.
# We can stop here.
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='
)):
...
@@ -449,7 +449,7 @@ def get_safe_part(key):
...
@@ -449,7 +449,7 @@ def get_safe_part(key):
assert
version
assert
version
# Find the hash part, which is using sha256, not md5.
# Find the hash part, which is using sha256, not md5.
# Instances of md5 will be replaced in future release.
# Instances of md5 will be replaced in future release.
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
...
...
theano/tensor/utils.py
浏览文件 @
59f42d11
...
@@ -20,8 +20,8 @@ def hash_from_ndarray(data):
...
@@ -20,8 +20,8 @@ def hash_from_ndarray(data):
# uint32 and int32 of zeros with the same shape and strides.
# uint32 and int32 of zeros with the same shape and strides.
# python hash are not strong, so use sha256 (md5 is not
# python hash are not strong, so use sha256 (md5 is not
# FIPS compatible). To not have too long of hash, I call it again on
# FIPS compatible). To not have too long of hash, I call it again on
# the concatenation of all parts.
# the concatenation of all parts.
if
not
data
.
flags
[
"C_CONTIGUOUS"
]:
if
not
data
.
flags
[
"C_CONTIGUOUS"
]:
# hash_from_code needs a C-contiguous array.
# hash_from_code needs a C-contiguous array.
data
=
np
.
ascontiguousarray
(
data
)
data
=
np
.
ascontiguousarray
(
data
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论