theislab / theislab/CellFlow

Torch backend implementation

Open
#248 2 comments 0 reactions 4 assignees View on GitHub

@selmanozleyen is already working on this.

Since May 28, 2025.

enhancement
Dominant language
Python
Stars
159
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Description of feature

Once we merged #228, #235, #239, #240, we can start with the torch backend implementation. Therefore

  • we will keep one CellFlow class for both backends
  • have a src/backends/jax and a src/backends/torch directory
  • CellFlow.prepare_model will have an argument backend: Literal["jax", "torch"]
  • for now, let's not implement GENOT for torch, let's just go with OTFlowMatching, to keep things simple-
  • the only problem which arises is that prepare_model takes backend-specific arguments, namely match_fn, optimizer, and vf_act_fn.

For the last point, I see the following as the best solution
allow passing both jax and torch instances, setting per default None , describe the default in the docs, and eventually instantiating them later in the solver classes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.