Device#

API#

warp_nn.utils.device.parse_device(
device: str | Device | None,
) Device[source]#

Parse the input device and return a Device instance.

If the specified device is None or it cannot be resolved, the default available device will be returned instead. For invalid device specifications, a warning message will be logged.

Parameters:

device – Device specification.

Returns:

Device.