提交 75ff0a33 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

PEP8

上级 3ce74063
...@@ -131,18 +131,18 @@ Op example ...@@ -131,18 +131,18 @@ Op example
return i0_shapes return i0_shapes
def grad(self, inputs, output_grads): def grad(self, inputs, output_grads):
return [output_grads[0]*2] return [output_grads[0] * 2]
Test it! Test it!
.. code-block:: python .. code-block:: python
x = theano.tensor.matrix() x = theano.tensor.matrix()
f = theano.function([x],DoubleOp()(x)) f = theano.function([x], DoubleOp()(x))
import numpy import numpy
inp = numpy.random.rand(5,5) inp = numpy.random.rand(5, 5)
out = f(inp) out = f(inp)
assert numpy.allclose(inp*2, out) assert numpy.allclose(inp * 2, out)
print inp print inp
print out print out
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论