提交 091559fe authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Do not touch strides for dimensions of length 1

CudaNdarray.filter rejects broadcastable dimensions with non-zero strides
上级 edd1c456
...@@ -26,8 +26,9 @@ def get_diagonal_subtensor_view(x, i0, i1): ...@@ -26,8 +26,9 @@ def get_diagonal_subtensor_view(x, i0, i1):
idx[i0] = slice(x.shape[i1] - 1, None, None) idx[i0] = slice(x.shape[i1] - 1, None, None)
xview = x.__getitem__(tuple(idx)) xview = x.__getitem__(tuple(idx))
strides = list(xview.strides) strides = list(xview.strides)
strides[i1] -= strides[i0] if x.shape[i1] != 1:
xview.strides = strides strides[i1] -= strides[i0]
xview.strides = strides
return xview return xview
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论