|
17 | 17 | from .bcast import * |
18 | 18 | from .base import * |
19 | 19 | from .index import * |
| 20 | +from .index import _Index4 |
20 | 21 |
|
21 | 22 | def _create_array(buf, numdims, idims, dtype): |
22 | 23 | out_arr = ct.c_void_p(0) |
@@ -152,9 +153,8 @@ def _get_info(dims, buf_len): |
152 | 153 |
|
153 | 154 | def _get_indices(key): |
154 | 155 |
|
155 | | - index_vec = Index * 4 |
156 | 156 | S = Index(slice(None)) |
157 | | - inds = index_vec(S, S, S, S) |
| 157 | + inds = _Index4(S, S, S, S) |
158 | 158 |
|
159 | 159 | if isinstance(key, tuple): |
160 | 160 | n_idx = len(key) |
@@ -874,7 +874,7 @@ def __getitem__(self, key): |
874 | 874 | inds = _get_indices(key) |
875 | 875 |
|
876 | 876 | safe_call(backend.get().af_index_gen(ct.pointer(out.arr), |
877 | | - self.arr, ct.c_longlong(n_dims), ct.pointer(inds))) |
| 877 | + self.arr, ct.c_longlong(n_dims), inds.pointer)) |
878 | 878 | return out |
879 | 879 | except RuntimeError as e: |
880 | 880 | raise IndexError(str(e)) |
@@ -903,7 +903,7 @@ def __setitem__(self, key, val): |
903 | 903 | inds = _get_indices(key) |
904 | 904 |
|
905 | 905 | safe_call(backend.get().af_assign_gen(ct.pointer(out_arr), |
906 | | - self.arr, ct.c_longlong(n_dims), ct.pointer(inds), |
| 906 | + self.arr, ct.c_longlong(n_dims), inds.pointer, |
907 | 907 | other_arr)) |
908 | 908 | safe_call(backend.get().af_release_array(self.arr)) |
909 | 909 | if del_other: |
|
0 commit comments