Lightweight DataTensor wrapper that mimics a subset of xarray.DataArray APIs on top of torch.Tensor.
Project description
xtensor
xtensor provides a DataTensor class that wraps a torch.Tensor with labels and coordinates inspired by xarray.DataArray. The goal is to enjoy lightweight labeled computations without leaving eager PyTorch workflows.
Features
- Construction from torch / numpy data with dimension names and coordinates.
- Factory helpers from
pandasobjects or existingxarray.DataArray. - Label (
sel) and positional (isel) slicing. - Mean, standard deviation, sum, min, max style reductions.
- Elementwise math with scalars or other
DataTensorobjects that share the same coordinates. - Device-agnostic
.to()mirror oftorch.Tensor.to.
Development
Install dependencies in editable mode.
pip install -e ".[dev]"
Run the tests.
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xtensor_datatensor-0.1.0.tar.gz.
File metadata
- Download URL: xtensor_datatensor-0.1.0.tar.gz
- Upload date:
- Size: 34.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8f52367cefdf77ed1872163881806db06de1cf13c6ed4f257815352d591d704
|
|
| MD5 |
655e83211812b9e85851bb5c5650955a
|
|
| BLAKE2b-256 |
89129f12b8379fcfce9db86dd74fbe92db668da03fd557c3d356d957e9fa5fd7
|
File details
Details for the file xtensor_datatensor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: xtensor_datatensor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd5da026c99239f811fa2ce103ea1f5c3fa3db1b6be821dc85d2c2360baf6c2d
|
|
| MD5 |
0db9279f2cca2441f993219e22601ad9
|
|
| BLAKE2b-256 |
1c0822dc92fcd9904159ff1966abec69df471a9ce7ea18a9ee5232d1256a36c7
|