fast_array_utils.conv#
Conversion utilities.
- fast_array_utils.conv.to_dense(x: CpuArray | DiskArray | sparray | spmatrix | CSRDataset | CSCDataset, /, *, order: Literal['K', 'A', 'C', 'F'] = 'K', to_cpu_memory: bool = False) NDArray[Any]#
- fast_array_utils.conv.to_dense(x: Array, /, *, order: Literal['K', 'A', 'C', 'F'] = 'K', to_cpu_memory: Literal[False] = False) Array
- fast_array_utils.conv.to_dense(x: Array, /, *, order: Literal['K', 'A', 'C', 'F'] = 'K', to_cpu_memory: Literal[True]) NDArray[Any]
- fast_array_utils.conv.to_dense(x: GpuArray | spmatrix, /, *, order: Literal['K', 'A', 'C', 'F'] = 'K', to_cpu_memory: Literal[False] = False) ndarray
- fast_array_utils.conv.to_dense(x: GpuArray | spmatrix, /, *, order: Literal['K', 'A', 'C', 'F'] = 'K', to_cpu_memory: Literal[True]) NDArray[Any]
- fast_array_utils.conv.to_dense(x: A, /, *, order: Literal['K', 'A', 'C', 'F'] = 'K', to_cpu_memory: Literal[False] = False) A
- fast_array_utils.conv.to_dense(x: A, /, *, order: Literal['K', 'A', 'C', 'F'] = 'K', to_cpu_memory: Literal[True]) NDArray[Any]
Convert x to a dense array.
If
to_cpu_memoryisFalse,dask.array.Arrays andcupy.ndarrays/cupyx.scipy.sparse.spmatrixinstances stay out-of-core and in GPU memory, respecively.- Parameters:
- x
Input object to be converted.
- order
The order of the output array:
C(row-major) orF(column-major).KandAderive the order fromx.The default matches numpy, and therefore diverges from the
scipy.sparsematrices’toarray()’s default behavior of always returning aC-contiguous array. Instead, CSC matrices become F-contiguous arrays whenorder="K"(the default).Dask
Arrays concatenation behavior will result inorderhaving no effect on thedask.compute()/to_cpu_memory=Trueresult.- to_cpu_memory
Also load data into memory (resulting in a
numpy.ndarray).
- Returns:
Dense form of
x
fast_array_utils.conv.scipy#
Utilities only for sparse matrices.