tensorsig
tensorsig provides differentiable signature, log-signature, and offset-coded
signature features for PyTorch.
The first release is being prepared. The public API may change between 0.x
releases.
Installation
tensorsig requires Python 3.14 or newer and PyTorch 2.14 or newer.
Until the first PyPI release, install from a checkout of this repository:
python -m pip install .
After publication, install with python -m pip install tensorsig.
Quick start
import torch
from tensorsig.classical.signatures import log_signature, signature
path = torch.tensor(
[[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [2.0, 1.0]]],
dtype=torch.float64,
)
first_turn = path[:, :3]
sig = signature(first_turn, depth=2)
logsig = log_signature(first_turn, depth=2)
assert sig.shape == (1, 6)
assert logsig.shape == (1, 3)
torch.testing.assert_close(
sig,
torch.tensor([[1.0, 1.0, 0.5, 1.0, 0.0, 0.5]], dtype=path.dtype),
)
torch.testing.assert_close(
logsig,
torch.tensor([[1.0, 1.0, 0.5]], dtype=path.dtype),
)
Start with the practitioner guides to signatures and logsignatures. The complete callable surface is in the API reference. The hosted documentation will become available with the first release. Until then, use the local preview described under Development.
Choosing local features
| Need | Start with |
|---|---|
| Classical logsignatures after path lifts | tensorsig.augmentations followed by classical.windows.WindowedLogSignature in torch.nn.Sequential |
| Signatures or logsignatures retaining local offset information | offset_coded_signatures.plans.LocalRealization with a codes.OffsetCode |
| Scalar polynomials in physical increments | offset_coded_signatures.plans.compile_polynomial |
| Apply a compiled local plan to a path | offset_coded_signatures.layers.LocalFeatures or LocalLinear |
| Explicit quotient window algorithms on increment streams | offset_coded_signatures.windows.WindowLogSignature |
The offset-coded signatures guide shows these constructions and their input conventions. Offset-coded windows count increments; classical windows count points. Path augmentations are shared across both families and run before window extraction.
Citing
If you use tensorsig, cite the software version or commit you used. Citation
metadata is provided in
CITATION.cff,
which GitHub exposes through Cite this repository in APA and BibTeX formats.
Zenodo DOI links will be added after the first archived release. For
reproducible work, use that release's version-specific DOI; use the concept
DOI when referring to tensorsig independently of a particular version.
Development
The project uses uv and keeps its development
environment in the committed uv.lock. Python requirements are defined in
pyproject.toml.
uv sync --locked
uv run ruff check .
uv run ruff format --check .
uv run pytest -q
Generate and strictly build the complete HTML documentation with:
uv run python scripts/generate_docs.py
To build, start a local preview, and open it in your browser:
uv run python scripts/generate_docs.py --serve
The HTML site is written to site/. Stop the preview with Ctrl+C. After editing
Python guides or docstrings, rerun the script to regenerate the documentation.
Validate a prepared release with scripts/release.sh --check X.Y.Z, then publish
it from clean main with scripts/release.sh X.Y.Z. Keep the package version and
CITATION.cff version aligned, and set date-released in CITATION.cff to the
actual release date before running the release checks. GitHub Actions publishes
to PyPI and deploys the documentation when the GitHub Release is published. The
PyPI Trusted Publisher and GitHub Pages Actions source must be configured before
the first release.
License
tensorsig is released under the
MIT License.
Metadata
Release files for tensorsig 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tensorsig-0.1.0.tar.gz | 155.9 kB | With provenance | Details for tensorsig-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tensorsig-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for tensorsig-0.1.0-py3-none-any.whl |
Total release size: 349.9 kB
Release files / tensorsig-0.1.0.tar.gz
| Download URL | tensorsig-0.1.0.tar.gz |
|---|---|
| Size | 155.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c55b58ec9d545d4f9a841896c3face69541e08dd6a408a4731e6f9159081e5c
|
|
BLAKE2b-256 checksum How to use checksums |
fb5511002a053d8403c9288ad7d945c9ade04dcde2584d8553d89cb6f418505c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / tensorsig-0.1.0-py3-none-any.whl
| Download URL | tensorsig-0.1.0-py3-none-any.whl |
|---|---|
| Size | 194.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
718bfb1c193829c3030ab5d39de7872489fad5e54def5a8d5e7d7cd280306da3
|
|
BLAKE2b-256 checksum How to use checksums |
0cc339418fbbed12265adf5b163d5ed5c208dc32153ec295d931e5fcac271774
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logSecurity for tensorsig 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for tensorsig-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.