Skip to main content

parse_device_string

Function parse_device_string 

Source
pub fn parse_device_string(device: &str) -> Result<DeviceType, PiperError>
Expand description

Parse a device string (“cpu”, “cuda”, “cuda:0”, “cuda:1”, “coreml”, “directml”, “directml:2”, “tensorrt”, “tensorrt:0”, “auto”) into a DeviceType.

The string is matched case-insensitively.