提交 81074cba authored 作者: Frederic's avatar Frederic

fix indentation in doctest

上级 90023285
...@@ -138,23 +138,23 @@ the params type. ...@@ -138,23 +138,23 @@ the params type.
params_type = Generic() params_type = Generic()
__props__ = ('mul',) __props__ = ('mul',)
def __init__(self, mul): def __init__(self, mul):
self.mul = float(mul) self.mul = float(mul)
def get_params(self, node): def get_params(self, node):
return self.mul return self.mul
def make_node(self, inp): def make_node(self, inp):
inp = as_scalar(inp) inp = as_scalar(inp)
return Apply(self, [inp], [inp.type()] return Apply(self, [inp], [inp.type()]
def perform(self, node, inputs, output_storage, params): def perform(self, node, inputs, output_storage, params):
# Here params is a python float so this is ok # Here params is a python float so this is ok
output_storage[0][0] = inputs[0] * params output_storage[0][0] = inputs[0] * params
def c_code(self, node, name, inputs, outputs, sub): def c_code(self, node, name, inputs, outputs, sub):
return ("%(z)s = %(x)s * PyFloat_AsDouble(%(p)s);" % return ("%(z)s = %(x)s * PyFloat_AsDouble(%(p)s);" %
dict(z=outputs[0], x=inputs[0], p=sub['params'])) dict(z=outputs[0], x=inputs[0], p=sub['params']))
.. testoutput:: .. testoutput::
:hide: :hide:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论