cunumeric.ndarray.tolist#

ndarray.tolist()#

Return the array as an a.ndim-levels deep nested list of Python scalars.

Return a copy of the array data as a (nested) Python list. Data items are converted to the nearest compatible builtin Python type, via the ~cunumeric.ndarray.item function.

If a.ndim is 0, then since the depth of the nested list is 0, it will not be a list at all, but a simple Python scalar.

Parameters:

None

Returns:

y – The possibly nested list of array elements. (object, or list of object, or list of list of object, or …)

Return type:

Any

Notes

The array may be recreated via a = cunumeric.array(a.tolist()), although this may sometimes lose precision.

Availability:

Multiple GPUs, Multiple CPUs