2022-01-13 20:06:32 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-02-10 20:34:41 +00:00
|
|
|
, jaxlib
|
2022-09-09 14:08:57 +00:00
|
|
|
, jax
|
2022-01-13 20:06:32 +00:00
|
|
|
, keras
|
|
|
|
, lib
|
|
|
|
, matplotlib
|
|
|
|
, msgpack
|
|
|
|
, numpy
|
|
|
|
, optax
|
2022-04-03 18:54:34 +00:00
|
|
|
, pytest-xdist
|
2022-01-13 20:06:32 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, tensorflow
|
2022-09-09 14:08:57 +00:00
|
|
|
, fetchpatch
|
|
|
|
, rich
|
2022-01-13 20:06:32 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "flax";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "0.6.1";
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-fZiODo+izOwGjCCTvi11GvUG/VQL1DV9bNXKjvIIw4A=";
|
2022-01-13 20:06:32 +00:00
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
buildInputs = [ jaxlib ];
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-09-09 14:08:57 +00:00
|
|
|
jax
|
2022-01-13 20:06:32 +00:00
|
|
|
matplotlib
|
|
|
|
msgpack
|
|
|
|
numpy
|
|
|
|
optax
|
2022-09-09 14:08:57 +00:00
|
|
|
rich
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"flax"
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
keras
|
2022-04-03 18:54:34 +00:00
|
|
|
pytest-xdist
|
2022-01-13 20:06:32 +00:00
|
|
|
pytestCheckHook
|
|
|
|
tensorflow
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"-W ignore::FutureWarning"
|
|
|
|
"-W ignore::DeprecationWarning"
|
|
|
|
];
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Docs test, needs extra deps + we're not interested in it.
|
|
|
|
"docs/_ext/codediff_test.py"
|
|
|
|
|
|
|
|
# The tests in `examples` are not designed to be executed from a single test
|
|
|
|
# session and thus either have the modules that conflict with each other or
|
|
|
|
# wrong import paths, depending on how they're invoked. Many tests also have
|
|
|
|
# dependencies that are not packaged in `nixpkgs` (`clu`, `jgraph`,
|
|
|
|
# `tensorflow_datasets`, `vocabulary`) so the benefits of trying to run them
|
|
|
|
# would be limited anyway.
|
|
|
|
"examples/*"
|
|
|
|
];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
disabledTests = [
|
|
|
|
# See https://github.com/google/flax/issues/2554.
|
|
|
|
"test_async_save_checkpoints"
|
|
|
|
"test_jax_array0"
|
|
|
|
"test_jax_array1"
|
|
|
|
"test_keep0"
|
|
|
|
"test_keep1"
|
|
|
|
"test_optimized_lstm_cell_matches_regular"
|
|
|
|
"test_overwrite_checkpoints"
|
|
|
|
"test_save_restore_checkpoints_target_empty"
|
|
|
|
"test_save_restore_checkpoints_target_none"
|
|
|
|
"test_save_restore_checkpoints_target_singular"
|
|
|
|
"test_save_restore_checkpoints_w_float_steps"
|
|
|
|
"test_save_restore_checkpoints"
|
|
|
|
];
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Neural network library for JAX";
|
|
|
|
homepage = "https://github.com/google/flax";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ ndl ];
|
|
|
|
};
|
|
|
|
}
|