forked from mirrors/nixpkgs
55 lines
929 B
Nix
55 lines
929 B
Nix
{ lib
|
|
, buildDunePackage
|
|
, fetchFromGitHub
|
|
, cmdliner
|
|
, ctypes
|
|
, npy
|
|
, ocaml-compiler-libs
|
|
, ppx_custom_printf
|
|
, ppx_expect
|
|
, ppx_sexp_conv
|
|
, sexplib
|
|
, stdio
|
|
, pytorch
|
|
}:
|
|
|
|
buildDunePackage rec {
|
|
pname = "torch";
|
|
version = "0.9b";
|
|
|
|
minimumOCamlVersion = "4.07";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "LaurentMazare";
|
|
repo = "ocaml-${pname}";
|
|
rev = version;
|
|
sha256 = "1xn8zfs3viz80agckcpl9a4vjbq6j5g280i95jyy5s0zbcnajpnm";
|
|
};
|
|
|
|
propagatedBuildInputs = [
|
|
cmdliner
|
|
ctypes
|
|
npy
|
|
ocaml-compiler-libs
|
|
pytorch
|
|
pytorch.dev
|
|
ppx_custom_printf
|
|
ppx_expect
|
|
ppx_sexp_conv
|
|
sexplib
|
|
stdio
|
|
];
|
|
|
|
preBuild = ''export LIBTORCH=${pytorch.dev}/'';
|
|
|
|
doCheck = true;
|
|
checkPhase = "dune runtest";
|
|
|
|
meta = with lib; {
|
|
inherit (src.meta) homepage;
|
|
description = "Ocaml bindings to Pytorch";
|
|
maintainers = [ maintainers.bcdarwin ];
|
|
license = licenses.asl20;
|
|
};
|
|
}
|