| 409 | |
| 410 | |
| 411 | class NumpyBackendEntrypoint(ArrayBackendEntrypoint): |
| 412 | @classmethod |
| 413 | def to_backend_dispatch(cls): |
| 414 | return to_numpy_dispatch |
| 415 | |
| 416 | @classmethod |
| 417 | def to_backend(cls, data: Array, **kwargs): |
| 418 | if isinstance(data._meta, np.ndarray): |
| 419 | # Already a numpy-backed collection |
| 420 | return data |
| 421 | return data.map_blocks(cls.to_backend_dispatch(), **kwargs) |
| 422 | |
| 423 | @property |
| 424 | def RandomState(self): |
| 425 | return np.random.RandomState |
| 426 | |
| 427 | @property |
| 428 | def default_bit_generator(self): |
| 429 | return np.random.PCG64 |
| 430 | |
| 431 | |
| 432 | array_creation_dispatch = CreationDispatch( |