API reference

andrey.describe#

andrey.describe()[source]#

The backend and worker settings in effect, with package and device availability.

Each operation picks its own implementation, so the report gives the preference, not the backend a given call will use. Checking whether the torch module is installed does not import it. GPU checks may import it on macOS or when the build supports CUDA or ROCm; an unrecognized build is also checked by importing it.

Returns:

A read-only snapshot with the fields backend (the preference, such as "auto"), num_workers (-1 means every usable core), torch (whether the module is installed or already imported), and cuda and mps (whether PyTorch reports a usable device). available_backends() maps numpy, cpu, cuda, and mps to availability; cpu uses the torch field. as_dict() returns backend, num_workers, and this availability mapping as a JSON-ready dict.

Return type:

Backend

Raises:

ValueError – If a setting read from ANDREY_BACKEND, ANDREY_DEVICE, or ANDREY_NUM_WORKERS holds an invalid value; a context or config override takes precedence over those variables.