File: 102635_strides0size0.patch

package info (click to toggle)
libgpuarray 0.7.6-13
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,176 kB
  • sloc: ansic: 19,235; python: 4,591; makefile: 208; javascript: 71; sh: 15
file content (17 lines) | stat: -rw-r--r-- 570 bytes parent folder | download
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)