File: 002-fix-for-test-file.patch

package info (click to toggle)
python-autoray 0.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,708 kB
  • sloc: python: 5,490; makefile: 20
file content (18 lines) | stat: -rw-r--r-- 622 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Description: Fix for issue with test related to indices.
 Patch to fix the indices to dtype 'int32' before passing them to
 check result.
Author: Pulak Bhushan <pulakbhushan@gmail.com>
Last-Update: 2024-02-23

--- a/tests/test_autoray.py
+++ b/tests/test_autoray.py
@@ -513,6 +513,9 @@ def test_take(backend):
         ind = gen_rand((num_inds,), "numpy", dtype="int64")
     else:
         ind = gen_rand((num_inds,), backend, dtype="int64")
+    
+    # Ensure indices are of dtype 'int32'
+    ind = ind.astype('int32')
 
     # Take along axis 1, and check if result makes sense
     B = ar.do("take", A, ind, axis=1)