mlx.core.array.tolist#

array.tolist(self) object#

Convert the array to a Python list.

Returns:

The Python list.

If the array is a scalar then a standard Python scalar is returned.

If the array has more than one dimension then the result is a nested list of lists.

The value type of the list corresponding to the last dimension is either bool, int or float depending on the dtype of the array.

Return type:

list