提交 d20a47ae authored 作者: Saizheng Zhang's avatar Saizheng Zhang

fix flake8 error

上级 4a3e11c1
...@@ -147,11 +147,11 @@ def print_global_stats(): ...@@ -147,11 +147,11 @@ def print_global_stats():
_profiler_printers = [] _profiler_printers = []
def register_profiler_printer(fct): def register_profiler_printer(fct):
_profiler_printers.append(fct) _profiler_printers.append(fct)
return fct return fct
class ProfileStats(object): class ProfileStats(object):
""" """
...@@ -1475,7 +1475,8 @@ class ProfileStats(object): ...@@ -1475,7 +1475,8 @@ class ProfileStats(object):
self.apply_time, self.apply_cimpl, self.output_size] self.apply_time, self.apply_cimpl, self.output_size]
for f in _profiler_printers: for f in _profiler_printers:
f(*params) f(*params)
class ScanProfileStats(ProfileStats): class ScanProfileStats(ProfileStats):
callcount = 0.0 callcount = 0.0
nbsteps = 0.0 nbsteps = 0.0
......
...@@ -18,6 +18,7 @@ from collections import deque ...@@ -18,6 +18,7 @@ from collections import deque
from six import string_types, iterbytes from six import string_types, iterbytes
from six.moves import xrange from six.moves import xrange
from six import iteritems
try: try:
import pygpu import pygpu
...@@ -1540,7 +1541,7 @@ class GpuSplit(HideC, Split): ...@@ -1540,7 +1541,7 @@ class GpuSplit(HideC, Split):
@theano.compile.profiling.register_profiler_printer @theano.compile.profiling.register_profiler_printer
def profile_printer(message, compile_time, fct_call_time, def profile_printer(message, compile_time, fct_call_time,
apply_time, apply_cimpl, outputs_size): apply_time, apply_cimpl, outputs_size):
if any([x.op.__class__.__name__.lower().startswith("gpu") if any([x.op.__class__.__name__.lower().startswith("gpu")
for x in apply_time.keys()]): for x in apply_time.keys()]):
......
...@@ -4,7 +4,6 @@ import logging ...@@ -4,7 +4,6 @@ import logging
import sys import sys
import warnings import warnings
import numpy import numpy
from six import iteritems
from six.moves import StringIO, xrange from six.moves import StringIO, xrange
import theano import theano
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论