1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
Description: Allow numpy strides of an 0-elements array to be 0
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/1026345
Forwarded: no
--- a/pygpu/tests/test_gpu_ndarray.py
+++ b/pygpu/tests/test_gpu_ndarray.py
@@ -690,7 +690,7 @@ def _cmp(x, y):
x = numpy.asarray(x)
assert x.shape == y.shape
assert x.dtype == y.dtype
- assert x.strides == y.strides
+ assert (x.strides == y.strides) or ((0 in x.shape) and all(s0==0 for s0 in x.strides))
if not numpy.all(x == y):
print(x)
print(y)
|