Skip to content

bagof.converters.numpy

Classes

ToDType

ToDType(hint: Any = UNSET, compose: bool = False)

Bases: Converter[T, Any]

Converter for numpy.dtype.

Methods:

like
like(__reentrant: tuple = ()) -> Any

Accept any dtype-like value as input.

__call__
__call__(value: Any) -> T

Convert the value to a numpy dtype.

ToNDArray

ToNDArray(hint: Any = UNSET, compose: bool = False)

Bases: ArrayConverter

Converter for numpy.ndarray.

A lazy (dask) array is computed, and a device (cupy) array is copied to the host, so that an array of any library converts.

Methods:

move
move(value: Any) -> Any

Compute a lazy array, and copy a device array to the host.