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

PEP8 fixes

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