ak.to_backend — Awkward Array 2.8.2 documentation (original) (raw)

Defined in awkward.operations.ak_to_backend on line 16.

ak.to_backend(array, backend, *, highlevel=True, behavior=None, attrs=None)#

Parameters:

Converts an array from "cpu", "cuda", "jax" kernels to "cpu","cuda", "jax", or "typetracer" .

Any components that are already in the desired backend are viewed, rather than copied, so this operation can be an inexpensive way to ensure that an array is ready for a particular library.

To use "cuda", the cupy package must be installed, either with

or

conda install -c conda-forge cupy

To use "jax", the jax package must be installed, either with

or

conda install -c conda-forge jax

See ak.kernels.