提交 9c605c00 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Flake8 for gof/compiledir.py

上级 46ef1c33
...@@ -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
...@@ -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([size for dir, size, ops in big_key_files]) big_total_size = sum([sz 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))
......
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论