Skip to content

Commit

Permalink
as_strided: Deal with length-zero shape/strides
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Jun 6, 2016
1 parent 26eb068 commit 1f6d1d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyopencl/array.py
Expand Up @@ -1711,8 +1711,10 @@ def as_strided(ary, shape=None, strides=None):

# undocumented for the moment

shape = shape or ary.shape
strides = strides or ary.strides
if shape is None:
shape = ary.shape
if strides is None:
strides = ary.strides

return Array(ary.queue, shape, ary.dtype, allocator=ary.allocator,
data=ary.data, strides=strides)
Expand Down

0 comments on commit 1f6d1d1

Please sign in to comment.