Skip to main content

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 pandas objects or existing xarray.DataArray.
  • Label (sel) and positional (isel) slicing.
  • Mean, standard deviation, sum, min, max style reductions.
  • Elementwise math with scalars or other DataTensor objects that share the same coordinates.
  • Device-agnostic .to() mirror of torch.Tensor.to.

Development

Install dependencies in editable mode.

pip install -e ".[dev]"

Run the tests.

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xtensor_datatensor-0.1.0.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xtensor_datatensor-0.1.0-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

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

Hashes for xtensor_datatensor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d8f52367cefdf77ed1872163881806db06de1cf13c6ed4f257815352d591d704
MD5 655e83211812b9e85851bb5c5650955a
BLAKE2b-256 89129f12b8379fcfce9db86dd74fbe92db668da03fd557c3d356d957e9fa5fd7

See more details on using hashes here.

File details

Details for the file xtensor_datatensor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for xtensor_datatensor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd5da026c99239f811fa2ce103ea1f5c3fa3db1b6be821dc85d2c2360baf6c2d
MD5 0db9279f2cca2441f993219e22601ad9
BLAKE2b-256 1c0822dc92fcd9904159ff1966abec69df471a9ce7ea18a9ee5232d1256a36c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page