ak.to_jax#

Defined in awkward.operations.ak_to_jax on line 13.

ak.to_jax(array)#

Converts an Awkward Array into a JAX Array, if possible.

If the data are numerical and regular (nested lists have equal lengths in each dimension, as described by the ak.Array.type), they can be losslessly converted to a JAX array and this function returns without an error.

Otherwise, the function raises an error.

If array is a scalar, it is converted into a JAX scalar.

See also ak.from_jax and ak.to_numpy.

Parameters:

array – Array-like data (anything ak.to_layout recognizes).

Returns:

A JAX array with the same data as array, if the conversion is possible.