device.ml
torch
torch.core
torch.toplevel
torch.vision
1 2 3 4 5 6 7 8 9 10 type t = | Cpu | Cuda of int (* Hardcoded, should match torch_api.cpp *) let to_int = function | Cpu -> -1 | Cuda i -> if i < 0 then Printf.sprintf "negative index for cuda device" |> failwith; i
1 2 3 4 5 6 7 8 9 10
type t = | Cpu | Cuda of int (* Hardcoded, should match torch_api.cpp *) let to_int = function | Cpu -> -1 | Cuda i -> if i < 0 then Printf.sprintf "negative index for cuda device" |> failwith; i