提交 11510f4d authored 作者: Frederic Bastien's avatar Frederic Bastien

[BUG] fix UnravelIndex in corner cases where it returned a view without…

[BUG] fix UnravelIndex in corner cases where it returned a view without declaring it. A test fail in the daily buidlbot.
上级 8dccbe6e
......@@ -21,6 +21,8 @@ learning/machine learning <https://mila.umontreal.ca/en/cours/>`_ classes).
News
====
* 2017/09/28: IMPORTANT: `MILA will stop developing Theano <https://groups.google.com/d/msg/theano-users/7Poq8BZutbY/rNCIfvAEAwAJ>`_ and the next release (renamed to 1.0) will be the last main release.
* 2017/09/20: Release of Theano 0.10.0beta3, new features and many bugfixes, release candidate to coming.
* 2017/09/07: Release of Theano 0.10.0beta2, new features and many bugfixes, release candidate to coming.
......
......@@ -1218,7 +1218,12 @@ class UnravelIndex(gof.Op):
res = np.unravel_index(indices, dims)
assert len(res) == len(out)
for i in xrange(len(out)):
out[i][0] = theano._asarray(res[i], node.outputs[0].dtype)
ret = theano._asarray(res[i], node.outputs[0].dtype)
if ret.base is not None:
# NumPy will return a view when it can.
# But we don't want that.
ret = ret.copy()
out[i][0] = ret
def unravel_index(indices, dims, order='C', ndim=None):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论