Skip to main content

torchTT

Tensor-Train decomposition in pytorch

Tensor-Train decomposition package written in Python on top of pytorch. Supports GPU acceleration and automatic differentiation. It also contains routines for solving linear systems in the TT format and performing adaptive cross approximation (the AMEN solver/cross interpolation is inspired form the MATLAB TT-Toolbox). Some routines are implemented in C++ for an increased execution speed.

Installation

Requirements

Following requirements are needed:

The GPU (if available) version of pytorch is recommended to be installed. Read the official installation guide for further info.

Using pip

You can install the package using the pip command:

pip install torchTT

The latest github version can be installed using:

pip install git+https://github.com/ion-g-ion/torchTT

One can also clone the repository and manually install the package:

git clone https://github.com/ion-g-ion/torchTT
cd torchTT
python setup.py install

Using uv

You can install the package using uv:

uv pip install torchTT

The latest github version can be installed using:

uv pip install git+https://github.com/ion-g-ion/torchTT

One can also clone the repository and install the package using uv:

git clone https://github.com/ion-g-ion/torchTT
cd torchTT
uv sync

Or install in editable mode:

uv pip install -e .

Development Installation

For development, you may want to install the package with additional development dependencies (pytest, sphinx, ipykernel, matplotlib):

Using pip:

pip install -e ".[dev]"

Using uv:

uv sync --extra dev

or

uv pip install -e ".[dev]"

This will install the package in editable mode along with all development tools needed for testing, building documentation, and working with Jupyter notebooks.

Components

The main modules/submodules that can be accessed after importing torchtt are briefly desctibed in the following table. Detailed description can be found here.

Component Description
torchtt Basic TT class and basic linear algebra functions.
torchtt.solvers Implementation of the AMEN solver.
torchtt.grad Wrapper for automatic differentiation.
torchtt.manifold Riemannian gradient and projection onto manifolds of tensors with fixed TT rank.
torchtt.nn Basic TT neural network layer.
torchtt.interpolate Cross approximation routines.

Tests

The directory tests/ from the root folder contains all the unittests. To run them use the command:

pytest tests/

Documentation and examples

The documentation can be found here. Following example scripts (as well as python notebooks) are also provied provided as part of the documentation:

Building Documentation

The documentation is generated using sphinx. To build it locally, you need:

  1. Install development dependencies (see Development Installation above)

  2. Install pandoc (required for rendering Jupyter notebooks):

  3. Build the documentation:

    make html
    

The generated documentation will be in _build/html/.

Author

Ion Gabriel Ion, e-mail: ion.ion.gabriel@gmail.com

Metadata

Release files for torchTT 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torchTT 0.5.0
File Size Uploaded
torchtt-0.5.0.tar.gz 2.4 MB Details

Release files / torchtt-0.5.0.tar.gz

Download URL torchtt-0.5.0.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
9794b1dfac2274e402f10cacd8c57c9b14ea806052c9e9390c54755e65fbeb27
BLAKE2b-256 checksum
How to use checksums
80cd86a29744ba58b9c8323bf60576e83c471013efe399d5e9d08a80f612d9cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

1 release file

0.4.0

1 release file

0.3

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page