提交 6c713d33 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Fix bug recently introduced in local_subtensor_merge.

上级 a2ea8184
...@@ -1232,7 +1232,7 @@ def local_subtensor_merge(node): ...@@ -1232,7 +1232,7 @@ def local_subtensor_merge(node):
if isinstance(idx2, scalar.basic.Scalar): if isinstance(idx2, scalar.basic.Scalar):
idx2 = T.tensor_from_scalar(node.inputs[1]) idx2 = T.tensor_from_scalar(node.inputs[1])
elif isinstance(idx2, int): elif isinstance(idx2, int):
idx2 = T.as_tensor_variable(idx1) idx2 = T.as_tensor_variable(idx2)
# The maximum is needed to don't have shape[0] - idx1 < 0 # The maximum is needed to don't have shape[0] - idx1 < 0
idx2_neg = T.maximum(u.owner.inputs[0].shape[0]+idx1, 0) idx2_neg = T.maximum(u.owner.inputs[0].shape[0]+idx1, 0)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论