mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-27 08:04:14 +00:00
2a5f1d4e57
Diff: https://github.com/deepmind/optax/compare/refs/tags/v0.2.3...v0.2.4 Changelog: https://github.com/deepmind/optax/releases/tag/v0.2.4
71 lines
1.2 KiB
Nix
71 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
|
|
# build-system
|
|
flit-core,
|
|
|
|
# dependencies
|
|
absl-py,
|
|
chex,
|
|
jax,
|
|
jaxlib,
|
|
numpy,
|
|
etils,
|
|
|
|
# tests
|
|
callPackage,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "optax";
|
|
version = "0.2.4";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "deepmind";
|
|
repo = "optax";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-7UPWeo/Q9/tjewaM7HN8/e7U1U1QzAliuk95+9GOi0E=";
|
|
};
|
|
|
|
outputs = [
|
|
"out"
|
|
"testsout"
|
|
];
|
|
|
|
build-system = [ flit-core ];
|
|
|
|
dependencies = [
|
|
absl-py
|
|
chex
|
|
etils
|
|
jax
|
|
jaxlib
|
|
numpy
|
|
] ++ etils.optional-dependencies.epy;
|
|
|
|
postInstall = ''
|
|
mkdir $testsout
|
|
cp -R examples $testsout/examples
|
|
'';
|
|
|
|
pythonImportsCheck = [ "optax" ];
|
|
|
|
# check in passthru.tests.pytest to escape infinite recursion with flax
|
|
doCheck = false;
|
|
|
|
passthru.tests = {
|
|
pytest = callPackage ./tests.nix { };
|
|
};
|
|
|
|
meta = {
|
|
description = "Gradient processing and optimization library for JAX";
|
|
homepage = "https://github.com/deepmind/optax";
|
|
changelog = "https://github.com/deepmind/optax/releases/tag/v${version}";
|
|
license = lib.licenses.asl20;
|
|
maintainers = with lib.maintainers; [ ndl ];
|
|
};
|
|
}
|