Skip to content

Commit e55c48f

Browse files
committed
Merge pull request #75 from davidweichiang/master
slice size should round up, not down
2 parents 8e4f7d8 + acb59dc commit e55c48f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pycuda/gpuarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ def __getitem__(self, index):
786786

787787
array_stride = self.strides[array_axis]
788788

789-
new_shape.append((stop-start)//idx_stride)
789+
new_shape.append((stop-start-1)//idx_stride+1)
790790
new_strides.append(idx_stride*array_stride)
791791
new_offset += array_stride*start
792792

0 commit comments

Comments
 (0)