Skip to content

Commit

Permalink
Fix RaggedArray stride and order assert
Browse files Browse the repository at this point in the history
Signed-off-by: Shaun Ren <[email protected]>
  • Loading branch information
shaunren committed Jul 16, 2016
1 parent 1308e04 commit b98872e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nengo_ocl/raggedarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class RaggedArray(object):
in the same underlying buffer.
"""

def __init__(self, arrays, names=None, dtype=None, align=False, order='C'):
assert order in 'CF'
assert order in ('C','F')

arrays = [np.asarray(a, order=order) for a in arrays]
assert len(arrays) > 0
Expand All @@ -57,7 +56,8 @@ def __init__(self, arrays, names=None, dtype=None, align=False, order='C'):
self.starts = starts
self.shape0s = [a.shape[0] if a.ndim > 0 else 1 for a in arrays]
self.shape1s = [a.shape[1] if a.ndim > 1 else 1 for a in arrays]
self.stride0s = [a.strides[0] // a.itemsize for a in arrays]
self.stride0s = [a.strides[0] // a.itemsize
if a.ndim > 0 else 1 for a in arrays]
self.stride1s = [a.strides[1] // a.itemsize
if a.ndim > 1 else 1 for a in arrays]

Expand Down

0 comments on commit b98872e

Please sign in to comment.