2020-07-18 16:06:22 +00:00
|
|
|
{ lib
|
2020-08-20 17:08:02 +00:00
|
|
|
, stdenv
|
2020-05-29 06:06:01 +00:00
|
|
|
, buildDunePackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmdliner
|
|
|
|
, ctypes
|
|
|
|
, npy
|
|
|
|
, ocaml-compiler-libs
|
|
|
|
, ppx_custom_printf
|
|
|
|
, ppx_expect
|
|
|
|
, ppx_sexp_conv
|
|
|
|
, sexplib
|
|
|
|
, stdio
|
|
|
|
, pytorch
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "torch";
|
2020-08-20 17:08:02 +00:00
|
|
|
version = "0.10";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
minimumOCamlVersion = "4.07";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-07-18 16:06:22 +00:00
|
|
|
owner = "LaurentMazare";
|
2020-05-29 06:06:01 +00:00
|
|
|
repo = "ocaml-${pname}";
|
|
|
|
rev = version;
|
2020-08-20 17:08:02 +00:00
|
|
|
sha256 = "1rqrv6hbical8chk0bl2nf60q6m4b5d1gab9fc5q03vkz2987f9b";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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}/'';
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
doCheck = !stdenv.isAarch64;
|
2020-05-29 06:06:01 +00:00
|
|
|
checkPhase = "dune runtest";
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
meta = with lib; {
|
2020-05-29 06:06:01 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "Ocaml bindings to Pytorch";
|
|
|
|
maintainers = [ maintainers.bcdarwin ];
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|