提交 63cb5dd9 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Remove the restriction on indexing a broadcastable dimension for…

Remove the restriction on indexing a broadcastable dimension for GpuAdvancedIncSubtensor1 and test that case.
上级 674d54f5
...@@ -2513,9 +2513,6 @@ class GpuAdvancedIncSubtensor1(tensor.AdvancedIncSubtensor1, GpuOp): ...@@ -2513,9 +2513,6 @@ class GpuAdvancedIncSubtensor1(tensor.AdvancedIncSubtensor1, GpuOp):
raise TypeError('index must be vector') raise TypeError('index must be vector')
if x_.type.ndim == 0: if x_.type.ndim == 0:
raise TypeError('cannot index into a scalar') raise TypeError('cannot index into a scalar')
if x_.type.broadcastable[0]:
# the caller should have made a copy of x len(ilist) times
raise TypeError('cannot index into a broadcastable dimension')
return Apply(self, [x_, y_, ilist_], [x_.type()]) return Apply(self, [x_, y_, ilist_], [x_.type()])
......
...@@ -986,6 +986,7 @@ class T_subtensor(theano.tensor.tests.test_subtensor.T_subtensor): ...@@ -986,6 +986,7 @@ class T_subtensor(theano.tensor.tests.test_subtensor.T_subtensor):
# optimized for that case. # optimized for that case.
((4, 4, 2, 3), [3, 3, 1, 1, 2, 2, 0, 0, ((4, 4, 2, 3), [3, 3, 1, 1, 2, 2, 0, 0,
-1, -2, -3, -4], False), -1, -2, -3, -4], False),
((1, 10), [0, 0], True),
]: ]:
# If there is not enough memory on the GPU, skip the test # If there is not enough memory on the GPU, skip the test
size_needed = numpy.prod(shape) * (4 + 1) size_needed = numpy.prod(shape) * (4 + 1)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论