提交 eeaba683 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

PEP8 fixes

上级 41f6111a
......@@ -714,7 +714,7 @@ class CSM(gof.Op):
def __str__(self):
if self.kmap is not None:
return "%s{%s}" %(self.__class__.__name__, str(self.kmap))
return "%s{%s}" % (self.__class__.__name__, str(self.kmap))
return self.__class__.__name__
def make_node(self, data, indices, indptr, shape):
......
......@@ -721,8 +721,9 @@ class test_csm(unittest.TestCase):
a = as_sparse_variable(sp_types[format](random_lil((4, 3),
dtype, 1)))
f = theano.function([x, y, z, s], tensor.grad(dense_from_sparse(
a * CSM(format)(x, y, z, s)).sum(), x))
f = theano.function([x, y, z, s],
tensor.grad(dense_from_sparse(
a * CSM(format)(x, y, z, s)).sum(), x))
spmat = sp_types[format](random_lil((4, 3), dtype, 3))
......@@ -1012,9 +1013,10 @@ class test_structureddot(unittest.TestCase):
overhead_tol = 0.002 # seconds
overhead_rtol = 1.1 # times as long
self.assertTrue(numpy.allclose(theano_result, scipy_result))
if not theano.config.mode in ["DebugMode", "DEBUG_MODE"] and theano.config.cxx:
self.assertFalse(theano_time > overhead_rtol * scipy_time +
overhead_tol)
if (not theano.config.mode in ["DebugMode", "DEBUG_MODE"] and
theano.config.cxx):
self.assertFalse(theano_time > overhead_rtol * scipy_time +
overhead_tol)
class DotTests(unittest.TestCase):
......@@ -1954,7 +1956,8 @@ class CastTester(utt.InferShapeTester):
func = theano.function([variable], cast(variable, o_dtype))
cls = theano.function([variable], Cast(o_dtype)(variable))
prop = theano.function([variable], variable.astype(o_dtype))
prop = theano.function([variable],
variable.astype(o_dtype))
t_func, t_cls, t_prop = func(data), cls(data), prop(data)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论