提交 f444ede4 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

pep8 extra_ops

上级 99612b72
...@@ -152,8 +152,8 @@ class BinCountOp(theano.Op): ...@@ -152,8 +152,8 @@ class BinCountOp(theano.Op):
output = self(*inputs) output = self(*inputs)
if output.dtype.find('int') != -1: if output.dtype.find('int') != -1:
return [ inp.zeros_like().astype(theano.config.floatX) return [inp.zeros_like().astype(theano.config.floatX)
for inp in inputs ] for inp in inputs]
raise NotImplementedError() raise NotImplementedError()
...@@ -261,7 +261,7 @@ class RepeatOp(theano.Op): ...@@ -261,7 +261,7 @@ class RepeatOp(theano.Op):
def connection_pattern(self, node): def connection_pattern(self, node):
return [ [True], [False] ] return [[True], [False]]
def grad(self, (x, repeats), (gz, )): def grad(self, (x, repeats), (gz, )):
if repeats.ndim == 0: if repeats.ndim == 0:
...@@ -277,7 +277,7 @@ class RepeatOp(theano.Op): ...@@ -277,7 +277,7 @@ class RepeatOp(theano.Op):
shape.insert(axis, repeats) shape.insert(axis, repeats)
return [gz.reshape(shape, x.ndim + 1).sum(axis=axis), return [gz.reshape(shape, x.ndim + 1).sum(axis=axis),
DisconnectedType()() ] DisconnectedType()()]
elif repeats.ndim == 1: elif repeats.ndim == 1:
# For this implementation, we would need to specify the length # For this implementation, we would need to specify the length
# of repeats in order to split gz in the right way to sum # of repeats in order to split gz in the right way to sum
...@@ -399,7 +399,6 @@ def bartlett(M): ...@@ -399,7 +399,6 @@ def bartlett(M):
return bartlett_(M) return bartlett_(M)
class FillDiagonal(gof.Op): class FillDiagonal(gof.Op):
# See function fill_diagonal for docstring # See function fill_diagonal for docstring
def __eq__(self, other): def __eq__(self, other):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论