提交 fa8a722b authored 作者: Mehdi Mirza's avatar Mehdi Mirza

multinomial grad changed to zeros_like

上级 29b78849
...@@ -5,7 +5,6 @@ from theano import Op, Apply ...@@ -5,7 +5,6 @@ from theano import Op, Apply
import theano.tensor as T import theano.tensor as T
from theano.gof import local_optimizer from theano.gof import local_optimizer
from theano.gof.python25 import any from theano.gof.python25 import any
from theano.gradient import DisconnectedType
from theano.sandbox.cuda import cuda_available, GpuOp from theano.sandbox.cuda import cuda_available, GpuOp
if cuda_available: if cuda_available:
...@@ -45,7 +44,7 @@ class MultinomialFromUniform(Op): ...@@ -45,7 +44,7 @@ class MultinomialFromUniform(Op):
def grad(self, ins, outgrads): def grad(self, ins, outgrads):
pvals, unis = ins pvals, unis = ins
(gz,) = outgrads (gz,) = outgrads
return [DisconnectedType()() for x in ins] return [T.zeros_like(x) for x in ins]
def c_code_cache_version(self): def c_code_cache_version(self):
return (5,) return (5,)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论