2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
hatchling,
|
|
|
|
jax,
|
|
|
|
jaxlib,
|
|
|
|
jaxtyping,
|
|
|
|
typing-extensions,
|
|
|
|
beartype,
|
|
|
|
optax,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
2023-08-10 07:59:29 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "equinox";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.11.4";
|
2023-10-19 13:55:26 +00:00
|
|
|
pyproject = true;
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "patrick-kidger";
|
2023-10-19 13:55:26 +00:00
|
|
|
repo = "equinox";
|
2023-08-10 07:59:29 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-3OwHND1YEdg/SppqiB7pCdp6v+lYwTbtX07tmyEMWDo=";
|
2023-08-10 07:59:29 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ hatchling ];
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
jax
|
|
|
|
jaxlib
|
|
|
|
jaxtyping
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
beartype
|
2023-10-19 13:55:26 +00:00
|
|
|
optax
|
2024-01-13 08:15:51 +00:00
|
|
|
pytest-xdist
|
2023-08-10 07:59:29 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "equinox" ];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabledTests = [
|
2024-05-15 15:35:15 +00:00
|
|
|
# For simplicity, JAX has removed its internal frames from the traceback of the following exception.
|
|
|
|
# https://github.com/patrick-kidger/equinox/issues/716
|
|
|
|
"test_abstract"
|
|
|
|
"test_complicated"
|
|
|
|
"test_grad"
|
|
|
|
"test_jvp"
|
|
|
|
"test_mlp"
|
|
|
|
"test_num_traces"
|
|
|
|
"test_pytree_in"
|
|
|
|
"test_simple"
|
|
|
|
"test_vmap"
|
|
|
|
|
|
|
|
# AssertionError: assert 'foo:\n pri...pe=float32)\n' == 'foo:\n pri...pe=float32)\n'
|
|
|
|
# Also reported in patrick-kidger/equinox#716
|
|
|
|
"test_backward_nan"
|
2024-04-21 15:54:59 +00:00
|
|
|
];
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "JAX library based around a simple idea: represent parameterised functions (such as neural networks) as PyTrees";
|
2024-01-13 08:15:51 +00:00
|
|
|
changelog = "https://github.com/patrick-kidger/equinox/releases/tag/v${version}";
|
2023-08-10 07:59:29 +00:00
|
|
|
homepage = "https://github.com/patrick-kidger/equinox";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ GaetanLepage ];
|
|
|
|
};
|
|
|
|
}
|