Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions pkgs/development/python-modules/flax/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{ buildPythonPackage
, fetchFromGitHub
, keras
, lib
, matplotlib
, msgpack
, numpy
, optax
, pytestCheckHook
, tensorflow
}:

buildPythonPackage rec {
pname = "flax";
version = "0.3.6";

src = fetchFromGitHub {
owner = "google";
repo = pname;
rev = "v${version}";
sha256 = "0zvq0vl88hiwmss49bnm7gdmndr1dfza2bcs1fj88a9r7w9dmlsr";
};

propagatedBuildInputs = [
matplotlib
msgpack
numpy
optax
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup.py file is mentioning additional requirements.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it's only missing jax, perhaps because of a circular dependency issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jax is already pulled in via chex -> optax, in fact it's redundant in their setup.py - not sure why they have it.


pythonImportsCheck = [
"flax"
];

checkInputs = [
keras
pytestCheckHook
tensorflow
];

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/*"
];

meta = with lib; {
description = "Neural network library for JAX";
homepage = "https://github.com/google/flax";
license = licenses.asl20;
maintainers = with maintainers; [ ndl ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2945,6 +2945,8 @@ in {
inherit (pkgs) flatbuffers;
};

flax = callPackage ../development/python-modules/flax { };

flexmock = callPackage ../development/python-modules/flexmock { };

flickrapi = callPackage ../development/python-modules/flickrapi { };
Expand Down