Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
9c605c00
提交
9c605c00
authored
5月 23, 2015
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Flake8 for gof/compiledir.py
上级
46ef1c33
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
17 行删除
+16
-17
compiledir.py
theano/gof/compiledir.py
+16
-16
test_flake8.py
theano/tests/test_flake8.py
+0
-1
没有找到文件。
theano/gof/compiledir.py
浏览文件 @
9c605c00
...
@@ -8,7 +8,6 @@ import re
...
@@ -8,7 +8,6 @@ import re
import
shutil
import
shutil
import
struct
import
struct
import
socket
import
socket
import
subprocess
import
sys
import
sys
import
textwrap
import
textwrap
...
@@ -55,16 +54,16 @@ def python_int_bitwidth():
...
@@ -55,16 +54,16 @@ def python_int_bitwidth():
compiledir_format_dict
=
{
compiledir_format_dict
=
{
"platform"
:
platform
.
platform
(),
"platform"
:
platform
.
platform
(),
"processor"
:
platform
.
processor
(),
"processor"
:
platform
.
processor
(),
"python_version"
:
platform
.
python_version
(),
"python_version"
:
platform
.
python_version
(),
"python_bitwidth"
:
local_bitwidth
(),
"python_bitwidth"
:
local_bitwidth
(),
"python_int_bitwidth"
:
python_int_bitwidth
(),
"python_int_bitwidth"
:
python_int_bitwidth
(),
"theano_version"
:
theano
.
__version__
,
"theano_version"
:
theano
.
__version__
,
"numpy_version"
:
numpy
.
__version__
,
"numpy_version"
:
numpy
.
__version__
,
"gxx_version"
:
gcc_version_str
.
replace
(
" "
,
"_"
),
"gxx_version"
:
gcc_version_str
.
replace
(
" "
,
"_"
),
"hostname"
:
socket
.
gethostname
(),
"hostname"
:
socket
.
gethostname
(),
}
}
def
short_platform
(
r
=
None
,
p
=
None
):
def
short_platform
(
r
=
None
,
p
=
None
):
...
@@ -182,8 +181,8 @@ def filter_compiledir(path):
...
@@ -182,8 +181,8 @@ def filter_compiledir(path):
if
not
os
.
access
(
path
,
os
.
R_OK
|
os
.
W_OK
|
os
.
X_OK
):
if
not
os
.
access
(
path
,
os
.
R_OK
|
os
.
W_OK
|
os
.
X_OK
):
# If it exist we need read, write and listing access
# If it exist we need read, write and listing access
raise
ValueError
(
raise
ValueError
(
"compiledir '
%
s' exists but you don't have read, write"
"compiledir '
%
s' exists but you don't have read, write"
" or listing permissions."
%
path
)
" or listing permissions."
%
path
)
else
:
else
:
try
:
try
:
os
.
makedirs
(
path
,
0770
)
# read-write-execute for user and group
os
.
makedirs
(
path
,
0770
)
# read-write-execute for user and group
...
@@ -295,7 +294,8 @@ def cleanup():
...
@@ -295,7 +294,8 @@ def cleanup():
have_npy_abi_version
=
True
have_npy_abi_version
=
True
elif
obj
.
startswith
(
'c_compiler_str='
):
elif
obj
.
startswith
(
'c_compiler_str='
):
have_c_compiler
=
True
have_c_compiler
=
True
elif
(
isinstance
(
obj
,
(
theano
.
gof
.
Op
,
theano
.
gof
.
Type
))
and
elif
(
isinstance
(
obj
,
(
theano
.
gof
.
Op
,
theano
.
gof
.
Type
))
and
hasattr
(
obj
,
'c_code_cache_version'
)):
hasattr
(
obj
,
'c_code_cache_version'
)):
v
=
obj
.
c_code_cache_version
()
v
=
obj
.
c_code_cache_version
()
if
v
not
in
[(),
None
]
and
v
not
in
key
[
0
]:
if
v
not
in
[(),
None
]
and
v
not
in
key
[
0
]:
...
@@ -310,7 +310,7 @@ def cleanup():
...
@@ -310,7 +310,7 @@ def cleanup():
if
keydata
.
key_pkl
!=
filename
:
if
keydata
.
key_pkl
!=
filename
:
keydata
.
key_pkl
=
filename
keydata
.
key_pkl
=
filename
keydata
.
remove_key
(
key
)
keydata
.
remove_key
(
key
)
except
IOError
as
e
:
except
IOError
:
_logger
.
error
(
_logger
.
error
(
"Could not remove file '
%
s'. To complete "
"Could not remove file '
%
s'. To complete "
"the clean-up, please remove manually "
"the clean-up, please remove manually "
...
@@ -395,7 +395,7 @@ def print_compiledir_content():
...
@@ -395,7 +395,7 @@ def print_compiledir_content():
if
big_key_files
:
if
big_key_files
:
big_key_files
=
sorted
(
big_key_files
,
key
=
lambda
t
:
str
(
t
[
1
]))
big_key_files
=
sorted
(
big_key_files
,
key
=
lambda
t
:
str
(
t
[
1
]))
big_total_size
=
sum
([
s
ize
for
dir
,
size
,
ops
in
big_key_files
])
big_total_size
=
sum
([
s
z
for
_
,
sz
,
_
in
big_key_files
])
print
((
"There are directories with key files bigger than
%
d bytes "
print
((
"There are directories with key files bigger than
%
d bytes "
"(they probably contain big tensor constants)"
%
"(they probably contain big tensor constants)"
%
max_key_file_size
))
max_key_file_size
))
...
...
theano/tests/test_flake8.py
浏览文件 @
9c605c00
...
@@ -268,7 +268,6 @@ whitelist_flake8 = [
...
@@ -268,7 +268,6 @@ whitelist_flake8 = [
"sparse/sandbox/truedot.py"
,
"sparse/sandbox/truedot.py"
,
"sparse/sandbox/sp.py"
,
"sparse/sandbox/sp.py"
,
"gof/destroyhandler.py"
,
"gof/destroyhandler.py"
,
"gof/compiledir.py"
,
"gof/unify.py"
,
"gof/unify.py"
,
"gof/lazylinker_c.py"
,
"gof/lazylinker_c.py"
,
"gof/optdb.py"
,
"gof/optdb.py"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论