abracudabra.device.library#

Library import functions for device types.

Attributes#

_DEVICE_TO_LIBRARY

A collection of mappings from device types to library names.

_DEFAULT_DEVICE_TYPE

The default device type, if the device type is not specified.

Functions#

_import_library(→ types.ModuleType)

get_np_or_cp(→ types.ModuleType)

Get the numpy or cupy library based on the device type.

get_pd_or_cudf(→ types.ModuleType)

Get the pandas or cudf library based on the device type.

Module Contents#

abracudabra.device.library._DEVICE_TO_LIBRARY: dict[str, dict[abracudabra.device.base.DeviceType, str]][source]#

A collection of mappings from device types to library names.

abracudabra.device.library._DEFAULT_DEVICE_TYPE: abracudabra.device.base.DeviceType = 'cpu'[source]#

The default device type, if the device type is not specified.

abracudabra.device.library._import_library(obj_name: str, device_type: abracudabra.device.base.DeviceType | None = None) types.ModuleType[source]#
abracudabra.device.library.get_np_or_cp(device_type: abracudabra.device.base.DeviceType | None = None) types.ModuleType[source]#

Get the numpy or cupy library based on the device type.

abracudabra.device.library.get_pd_or_cudf(device_type: abracudabra.device.base.DeviceType | None = None) types.ModuleType[source]#

Get the pandas or cudf library based on the device type.