提交 680764d7 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

fix bug in Trunc.grad

上级 3031b1c7
......@@ -1771,7 +1771,7 @@ class Trunc(UnaryScalarOp):
return numpy.trunc(x)
def grad(self, (x,), (gz,)):
return x.zeros_like().astype(theano.config.floatX)
return [ x.zeros_like().astype(theano.config.floatX) ]
def c_code(self, node, name, (x,), (z,), sub):
return "%(z)s = %(x)s >= 0? floor(%(x)s): -floor(-%(x)s);" % locals()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论