MCPcopy Create free account
hub / github.com/dask/dask / to_backend

Function to_backend

dask/array/creation.py:35–57  ·  view source on GitHub ↗

Move an Array collection to a new backend Parameters ---------- x : Array The input Array collection. backend : str, Optional The name of the new backend to move to. The default is the current "array.backend" configuration. Returns ------- dask.A

(x: Array, backend: str | None = None, **kwargs)

Source from the content-addressed store, hash-verified

33
34
35def to_backend(x: Array, backend: str | None = None, **kwargs):
36 """Move an Array collection to a new backend
37
38 Parameters
39 ----------
40 x : Array
41 The input Array collection.
42 backend : str, Optional
43 The name of the new backend to move to. The default
44 is the current "array.backend" configuration.
45
46 Returns
47 -------
48 dask.Array
49 A new Array collection with the backend specified
50 by ``backend``.
51 """
52 # Get desired backend
53 backend = backend or array_creation_dispatch.backend
54 # Check that "backend" has a registered entrypoint
55 backend_entrypoint = array_creation_dispatch.dispatch(backend)
56 # Call `ArrayBackendEntrypoint.to_backend`
57 return backend_entrypoint.to_backend(x, **kwargs)
58
59
60def empty_like(a, dtype=None, order="C", chunks=None, name=None, shape=None):

Callers 1

to_backendMethod · 0.90

Calls 2

dispatchMethod · 0.45
to_backendMethod · 0.45

Tested by

no test coverage detected