depot/third_party/nixpkgs/pkgs/development/python-modules/torchsde/default.nix
Default email 94427deb9d Project import generated by Copybara.
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
2023-05-24 16:37:59 +03:00

67 lines
1.3 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
# build-system
, setuptools
# dependencies
, boltons
, numpy
, scipy
, torch
, trampoline
# tests
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "torchsde";
version = "0.2.4";
format = "pyproject";
src = fetchFromGitHub {
owner = "google-research";
repo = "torchsde";
rev = "v${version}";
hash = "sha256-qQ7oswm0qTdq1xpQElt5cd3K0zskH+H/lgyEnxbCqsI=";
};
postPatch = ''
substituteInPlace setup.py \
--replace "numpy==1.19.*" "numpy" \
--replace "scipy==1.5.*" "scipy"
'';
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
boltons
numpy
scipy
torch
trampoline
];
pythonImportsCheck = [ "torchsde" ];
nativeCheckInputs = [
pytestCheckHook
];
disabledTests = [
# RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.
"test_adjoint"
];
meta = with lib; {
changelog = "https://github.com/google-research/torchsde/releases/tag/v${version}";
description = "Differentiable SDE solvers with GPU support and efficient sensitivity analysis";
homepage = "https://github.com/google-research/torchsde";
license = licenses.asl20;
maintainers = teams.tts.members;
};
}