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
1 change: 1 addition & 0 deletions docs/source/design/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ users should reason about them.
conversion_policy
dtype_policy
checking_policy
backend_ops_array_api
8 changes: 8 additions & 0 deletions docs/source/tutorials/backend_ops.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ What BackendOps signifies
internals. It mostly wraps NumPy-like methods, while normalizing the minimal
signatures that SpaceCore relies on.

Common dense-array methods are implemented once in ``BackendOps`` by delegating
to an Array API compatible ``xp`` namespace. NumPy and PyTorch use
``array-api-compat`` wrappers, while JAX uses ``jax.numpy``. Concrete backend
classes keep behavior that is genuinely backend-specific, such as dtype
sanitation, sparse conversion, indexed updates, device/autograd controls, and
control-flow primitives. ``ops.xp`` is available as an escape hatch, but
portable SpaceCore code should prefer explicit ``ops`` methods.

For example, NumPy and JAX expose different optional arguments for matrix
multiplication, but SpaceCore's portable interface only needs the common core:

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ authors = [
{ name = "Pavlo Pelikh" }
]
dependencies = [
"array-api-compat>=1.14.0",
"numpy>=2.0.0",
"scipy>=1.17",
]
Expand Down
Loading
Loading