Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a793ab8d
提交
a793ab8d
authored
7月 14, 2015
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix circular import by refactoring
上级
700d883b
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
35 行增加
和
31 行删除
+35
-31
configparser.py
theano/configparser.py
+1
-1
cc.py
theano/gof/cc.py
+0
-26
cmodule.py
theano/gof/cmodule.py
+1
-1
utils.py
theano/gof/utils.py
+30
-0
nvcc_compiler.py
theano/sandbox/cuda/nvcc_compiler.py
+1
-1
utils.py
theano/sparse/utils.py
+1
-1
utils.py
theano/tensor/utils.py
+1
-1
没有找到文件。
theano/configparser.py
浏览文件 @
a793ab8d
...
@@ -177,7 +177,7 @@ def get_config_md5():
...
@@ -177,7 +177,7 @@ def get_config_md5():
"""
"""
all_opts
=
sorted
([
c
for
c
in
_config_var_list
if
c
.
in_c_key
],
all_opts
=
sorted
([
c
for
c
in
_config_var_list
if
c
.
in_c_key
],
key
=
lambda
cv
:
cv
.
fullname
)
key
=
lambda
cv
:
cv
.
fullname
)
return
theano
.
gof
.
cc
.
hash_from_code
(
'
\n
'
.
join
(
return
theano
.
gof
.
utils
.
hash_from_code
(
'
\n
'
.
join
(
[
'
%
s =
%
s'
%
(
cv
.
fullname
,
cv
.
__get__
())
for
cv
in
all_opts
]))
[
'
%
s =
%
s'
%
(
cv
.
fullname
,
cv
.
__get__
())
for
cv
in
all_opts
]))
...
...
theano/gof/cc.py
浏览文件 @
a793ab8d
...
@@ -36,36 +36,10 @@ AddConfigVar('gcc.cxxflags',
...
@@ -36,36 +36,10 @@ AddConfigVar('gcc.cxxflags',
"Extra compiler flags for gcc"
,
"Extra compiler flags for gcc"
,
StrParam
(
""
))
StrParam
(
""
))
if
PY3
:
import
hashlib
def
hash_from_code
(
msg
):
# hashlib.md5() requires an object that supports buffer interface,
# but Python 3 (unicode) strings don't.
if
isinstance
(
msg
,
str
):
msg
=
msg
.
encode
()
# Python 3 does not like module names that start with
# a digit.
return
'm'
+
hashlib
.
md5
(
msg
)
.
hexdigest
()
else
:
import
hashlib
def
hash_from_code
(
msg
):
try
:
return
hashlib
.
md5
(
msg
)
.
hexdigest
()
except
TypeError
:
assert
isinstance
(
msg
,
numpy
.
ndarray
)
return
hashlib
.
md5
(
numpy
.
getbuffer
(
msg
))
.
hexdigest
()
_logger
=
logging
.
getLogger
(
"theano.gof.cc"
)
_logger
=
logging
.
getLogger
(
"theano.gof.cc"
)
def
hash_from_file
(
file_path
):
"""Return the MD5 hash of a file."""
return
hash_from_code
(
open
(
file_path
,
'rb'
)
.
read
())
run_cthunk
=
None
# Will be imported only when needed.
run_cthunk
=
None
# Will be imported only when needed.
...
...
theano/gof/cmodule.py
浏览文件 @
a793ab8d
...
@@ -24,7 +24,7 @@ from theano.compat import PY3, decode, decode_iter
...
@@ -24,7 +24,7 @@ from theano.compat import PY3, decode, decode_iter
from
six
import
b
,
BytesIO
,
StringIO
,
string_types
,
iteritems
from
six
import
b
,
BytesIO
,
StringIO
,
string_types
,
iteritems
from
theano.gof.utils
import
flatten
from
theano.gof.utils
import
flatten
from
theano.configparser
import
config
from
theano.configparser
import
config
from
theano.gof.
cc
import
hash_from_code
from
theano.gof.
utils
import
hash_from_code
from
theano.misc.windows
import
(
subprocess_Popen
,
from
theano.misc.windows
import
(
subprocess_Popen
,
output_subprocess_Popen
)
output_subprocess_Popen
)
...
...
theano/gof/utils.py
浏览文件 @
a793ab8d
...
@@ -3,9 +3,11 @@ import linecache
...
@@ -3,9 +3,11 @@ import linecache
import
traceback
import
traceback
import
sys
import
sys
import
numpy
from
six
import
iteritems
from
six
import
iteritems
from
theano
import
config
from
theano
import
config
from
theano.compat
import
PY3
def
simple_extract_stack
(
f
=
None
,
limit
=
None
):
def
simple_extract_stack
(
f
=
None
,
limit
=
None
):
...
@@ -435,3 +437,31 @@ def remove(predicate, coll):
...
@@ -435,3 +437,31 @@ def remove(predicate, coll):
[1, 3]
[1, 3]
"""
"""
return
[
x
for
x
in
coll
if
not
predicate
(
x
)]
return
[
x
for
x
in
coll
if
not
predicate
(
x
)]
if
PY3
:
import
hashlib
def
hash_from_code
(
msg
):
# hashlib.md5() requires an object that supports buffer interface,
# but Python 3 (unicode) strings don't.
if
isinstance
(
msg
,
str
):
msg
=
msg
.
encode
()
# Python 3 does not like module names that start with
# a digit.
return
'm'
+
hashlib
.
md5
(
msg
)
.
hexdigest
()
else
:
import
hashlib
def
hash_from_code
(
msg
):
try
:
return
hashlib
.
md5
(
msg
)
.
hexdigest
()
except
TypeError
:
assert
isinstance
(
msg
,
numpy
.
ndarray
)
return
hashlib
.
md5
(
numpy
.
getbuffer
(
msg
))
.
hexdigest
()
def
hash_from_file
(
file_path
):
"""Return the MD5 hash of a file."""
return
hash_from_code
(
open
(
file_path
,
'rb'
)
.
read
())
theano/sandbox/cuda/nvcc_compiler.py
浏览文件 @
a793ab8d
...
@@ -10,7 +10,7 @@ import numpy
...
@@ -10,7 +10,7 @@ import numpy
from
theano.compat
import
decode
,
decode_iter
from
theano.compat
import
decode
,
decode_iter
from
theano.gof
import
local_bitwidth
from
theano.gof
import
local_bitwidth
from
theano.gof.
cc
import
hash_from_file
from
theano.gof.
utils
import
hash_from_file
from
theano.gof.cmodule
import
(
std_libs
,
std_lib_dirs
,
from
theano.gof.cmodule
import
(
std_libs
,
std_lib_dirs
,
std_include_dirs
,
dlimport
,
std_include_dirs
,
dlimport
,
Compiler
,
Compiler
,
...
...
theano/sparse/utils.py
浏览文件 @
a793ab8d
from
theano.gof.
cc
import
hash_from_code
from
theano.gof.
utils
import
hash_from_code
def
hash_from_sparse
(
data
):
def
hash_from_sparse
(
data
):
...
...
theano/tensor/utils.py
浏览文件 @
a793ab8d
...
@@ -2,7 +2,7 @@ import numpy
...
@@ -2,7 +2,7 @@ import numpy
import
theano
import
theano
from
theano.compat
import
izip
from
theano.compat
import
izip
from
theano.gof.
cc
import
hash_from_code
from
theano.gof.
utils
import
hash_from_code
def
hash_from_ndarray
(
data
):
def
hash_from_ndarray
(
data
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论