ak.to_cupy#
Defined in awkward.operations.ak_to_cupy on line 13.
- ak.to_cupy(array)#
- Parameters:
array – Array-like data (anything
ak.to_layoutrecognizes).
Converts
array(many types supported) into a CuPy 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 CuPy array and this function returns without an error.Otherwise, the function raises an error.
If
arrayis a scalar, it is converted into a CuPy scalar.See also
ak.from_cupyandak.to_numpy.