| 170 | |
| 171 | |
| 172 | def test_vindex(): |
| 173 | x_np = np.arange(56).reshape((7, 8)) |
| 174 | x_cp = cupy.arange(56).reshape((7, 8)) |
| 175 | |
| 176 | d_np = da.from_array(x_np, chunks=(3, 4)) |
| 177 | d_cp = da.from_array(x_cp, chunks=(3, 4)) |
| 178 | |
| 179 | res_np = da.core._vindex(d_np, [0, 1, 6, 0], [0, 1, 0, 7]) |
| 180 | res_cp = da.core._vindex(d_cp, [0, 1, 6, 0], [0, 1, 0, 7]) |
| 181 | |
| 182 | assert type(res_cp._meta) == cupy.ndarray |
| 183 | assert_eq( |
| 184 | res_cp, res_cp, check_type=False |
| 185 | ) # Check that _meta and computed arrays match types |
| 186 | |
| 187 | assert_eq(res_np, res_cp, check_type=False) |
| 188 | |
| 189 | |
| 190 | def test_view(): |