package torch

  1. Overview
  2. Docs
PyTorch bindings for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

0.6.tar.gz
md5=b28b55cecdacca58b4dabf423b67b109
sha512=2118250a8295f713fee79f45afe098b051b62c2d9bd2c58d4762b6e9b00f86b870cee7b7b1d4105b4e93c30f86762a1c89f246842cddfe38dc2cd49bed5bf81d

doc/src/torch.core/device.ml.html

Source file device.ml

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
OCaml

Innovation. Community. Security.