提交 1ac7ebfa authored 作者: Razvan Pascanu's avatar Razvan Pascanu

corrected grad of dimshuffle

上级 087c502c
...@@ -391,7 +391,8 @@ PyArray_SetBaseObject(%(res)s, (PyObject*)%(basename)s); ...@@ -391,7 +391,8 @@ PyArray_SetBaseObject(%(res)s, (PyObject*)%(basename)s);
# canonicalization optimization phase will remove the inplace. # canonicalization optimization phase will remove the inplace.
# The inplace will be reintroduced automatically later in the graph. # The inplace will be reintroduced automatically later in the graph.
if 'int' in inp[0].dtype: if 'int' in inp[0].dtype:
return [DisconnectedType()()] return [theano.tensor.zeros_like(inp[0],
dtype=theano.config.floatX)]
else: else:
return [DimShuffle(gz.type.broadcastable, grad_order)( return [DimShuffle(gz.type.broadcastable, grad_order)(
Elemwise(scalar.identity)(gz))] Elemwise(scalar.identity)(gz))]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论