(x, dtype, order="C")
| 280 | |
| 281 | |
| 282 | def view(x, dtype, order="C"): |
| 283 | if order == "C": |
| 284 | try: |
| 285 | x = np.ascontiguousarray(x, like=x) |
| 286 | except TypeError: |
| 287 | x = np.ascontiguousarray(x) |
| 288 | return x.view(dtype) |
| 289 | else: |
| 290 | try: |
| 291 | x = np.asfortranarray(x, like=x) |
| 292 | except TypeError: |
| 293 | x = np.asfortranarray(x) |
| 294 | return x.T.view(dtype).T |
| 295 | |
| 296 | |
| 297 | def slice_with_int_dask_array(x, idx, offset, x_size, axis): |