Practical overview
When it fits
Use Tsl when a spatiotemporal research or development workflow needs data preparation and model prototyping in the PyTorch ecosystem, particularly for graph-based forecasting.
Who it is for
- Researchers developing neural methods for spatiotemporal data.
- Python developers prototyping graph neural network forecasting models.
- Teams building preprocessing pipelines and reusable datasets for time-varying data.
Documented uses
- Scale, resample and cluster time series before modeling.
- Handle missing data and irregularities in network structures.
- Create custom datasets and models or explore existing ones for benchmarking.
- Prototype and compare neural forecasting experiments.
Requirements & limits
The project is open source under the MIT license. Its README documents Python 3.10–3.14 and recommends uv for installation.
- The documented dependency ranges are NumPy >= 1.26 and < 3, PyTorch >= 2.2 and < 2.13, and PyG >= 2.4 and < 3.
- The recommended uv command resolves PyTorch and PyG alongside Tsl; a separate framework installation is not required for that setup.
- torch-sparse is optional and only needed for torch_sparse.SparseTensor adjacency matrices; it requires matching torch-scatter at runtime.
- PyTorch Lightning integration is documented for scaling computations from a CPU to GPU clusters.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install Tsl in a uv environment
Set up the library and its PyTorch and PyG dependencies for local use.
Before you start
- Python 3.10 is used in the documented setup example.
- The README lists NumPy >= 1.26 and < 3, PyTorch >= 2.2 and < 2.13, and PyG >= 2.4 and < 3.
- The documented setup uses uv.
Steps
Create an environment with the command below.
uv venv --python 3.10Install Tsl and let uv resolve a compatible PyTorch backend with the command below.
uv pip install torch-spatiotemporal --torch-backend=auto
Expected outcome
A local environment with Tsl and its PyTorch and PyG dependencies resolved by uv.
Guide limitations
- The automatic backend selects CUDA on NVIDIA systems with a compatible driver and CPU wheels otherwise; macOS uses PyTorch's macOS wheels, with GPU acceleration handled through MPS rather than CUDA.
- Optional torch-sparse support requires matching torch-sparse and torch-scatter packages and wheels compatible with the PyTorch and CUDA build.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 November 2026
- Original website title
- TorchSpatiotemporal/tsl · Official homepage title · retained in its source language

