How to Contribute

Contributions to Storch are most welcome. Please have a look at the existing issues or don't hesitate to open a new one to discuss ideas.

Development setup

You need to have sbt installed to build Storch from source.

Then clone the git repo and you should be ready to go.

git clone

Enabling GPU support during development

GPU support is disabled by default. To enable it, set the following parameter inside the sbt shell:

set ThisBuild / enableGPU := true

You can verify if the GPU is working by running the LeNet example. If it's working, you should see an output like this:

sbt examples/runMain LeNetApp
[info] running (fork) LeNetApp 
[info] Using device: Device(CUDA,-1)

Edit the documentation

Documentation sources live in the docs directory. We use mdoc for typechecked documenation and to embed code output. The website is rendered by Laika. To build the documentation locally, you can run the following command:

sbt ~tlSitePreview

Then open http://localhost:4242 in a browser enjoy a live preview while hacking on the docs.

To just build Scaladoc for all modules, you can run

sbt ~unidoc


Manually run headerCrate + scalafmt on all files:

sbt 'headerCreateAll ; scalafmtAll'

Add useful git pre-push linting checks:

cp git-hooks/pre-push-checks .git/hooks/ && chmod +x git-hooks/pre-push-checks

Optional: Install dependencies via nix + devenv

You can use nix and devenv to install your develepment environment, but it's not required.

  1. Install nix package manager
sh <(curl -L --daemon

For more info, see

  1. Install devenv
nix profile install --accept-flake-config github:cachix/devenv/latest

For more info, see:

  1. (Optionally) Install direnv

This will load the specific environment variables upon cd into the storch folder

nix profile install 'nixpkgs#direnv'
  1. Load environment

If you did not install direnv, run the following in the storch root folder:

devenv shell

If you installed direnv, just cd into storch