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

mrg multinomial gard is returning zero which will raises TypeErr. Changed to…

mrg multinomial gard is returning zero which will raises TypeErr. Changed to returning DisconnectedType
上级 82a17931
...@@ -5,6 +5,7 @@ from theano import Op, Apply ...@@ -5,6 +5,7 @@ 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:
...@@ -44,7 +45,7 @@ class MultinomialFromUniform(Op): ...@@ -44,7 +45,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 [None, None] return [DisconnectedType()() for x in ins]
def c_code_cache_version(self): def c_code_cache_version(self):
return (5,) return (5,)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论