提交 867bba87 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Flake8 for gof/callcache.py

上级 52843bcb
import cPickle, logging import cPickle
import logging
_logger = logging.getLogger("theano.gof.callcache") _logger = logging.getLogger("theano.gof.callcache")
...@@ -18,9 +19,6 @@ class CallCache(object): ...@@ -18,9 +19,6 @@ class CallCache(object):
def persist(self, filename=None): def persist(self, filename=None):
if filename is None: if filename is None:
filename = self.filename filename = self.filename
# backport
#filename = self.filename if filename is None else filename
f = open(filename, 'w') f = open(filename, 'w')
cPickle.dump(self.cache, f) cPickle.dump(self.cache, f)
f.close() f.close()
...@@ -28,9 +26,6 @@ class CallCache(object): ...@@ -28,9 +26,6 @@ class CallCache(object):
def call(self, fn, args=(), key=None): def call(self, fn, args=(), key=None):
if key is None: if key is None:
key = (fn, tuple(args)) key = (fn, tuple(args))
# backport
#key = (fn, tuple(args)) if key is None else key
if key not in self.cache: if key not in self.cache:
_logger.debug('cache miss %i', len(self.cache)) _logger.debug('cache miss %i', len(self.cache))
self.cache[key] = fn(*args) self.cache[key] = fn(*args)
......
...@@ -270,7 +270,6 @@ whitelist_flake8 = [ ...@@ -270,7 +270,6 @@ whitelist_flake8 = [
"gof/destroyhandler.py", "gof/destroyhandler.py",
"gof/unify.py", "gof/unify.py",
"gof/graph.py", "gof/graph.py",
"gof/callcache.py",
"gof/type.py", "gof/type.py",
"gof/__init__.py", "gof/__init__.py",
"gof/cc.py", "gof/cc.py",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论