提交 3cfa8d97 authored 作者: notoraptor's avatar notoraptor

Replace integer_dtypes with discrete_dtypes

in a `grad()` function.
上级 1d3f1df6
...@@ -386,7 +386,7 @@ PyArray_SetBaseObject(%(res)s, (PyObject*)%(basename)s); ...@@ -386,7 +386,7 @@ PyArray_SetBaseObject(%(res)s, (PyObject*)%(basename)s);
# Do not make the DimShuffle inplace as an optimization at the # Do not make the DimShuffle inplace as an optimization at the
# 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 inp[0].dtype in theano.tensor.integer_dtypes: if inp[0].dtype in theano.tensor.discrete_dtypes:
return [inp[0].zeros_like(dtype=theano.config.floatX)] return [inp[0].zeros_like(dtype=theano.config.floatX)]
else: else:
return [DimShuffle(gz.type.broadcastable, grad_order)( return [DimShuffle(gz.type.broadcastable, grad_order)(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论