提交 e0eca757 authored 作者: John Salvatier's avatar John Salvatier

broadcastable calculation fix for advancedsubtensor

上级 67398f35
...@@ -7269,7 +7269,8 @@ def adv_broadcastable(a, idx): ...@@ -7269,7 +7269,8 @@ def adv_broadcastable(a, idx):
newidx = tuple(map(replace_slice, idx)) newidx = tuple(map(replace_slice, idx))
fakeshape = [bc + 1 for bc in a.broadcastable] #2 - True = 1; 2 - False = 2
fakeshape = [2 - bc for bc in a.broadcastable]
retshape = numpy.empty(fakeshape)[newidx].shape retshape = numpy.empty(fakeshape)[newidx].shape
return tuple([dim == 1 for dim in retshape]) return tuple([dim == 1 for dim in retshape])
...@@ -7342,7 +7343,6 @@ class AdvancedSubtensor(Op): ...@@ -7342,7 +7343,6 @@ class AdvancedSubtensor(Op):
*rest)] + \ *rest)] + \
[DisconnectedType()()] * len(rest) [DisconnectedType()()] * len(rest)
class AdvancedIncSubtensor(Op): class AdvancedIncSubtensor(Op):
"""Increments a subtensor using advanced indexing. """Increments a subtensor using advanced indexing.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论