Skip to main content

A flexible linear operator abstraction in pytorch.

Project description

torch-named-linops

A flexible linear operator abstraction implemented in PyTorch.

Heavily inspired by einops.

Unrelated to the (also good) torch_linops

Selected Feature List

  • Dedicated abstraction for naming linear operator dimensions.
  • A set of core linops, including:
    • Dense
    • Diagonal
    • FFT
    • ArrayToBlocks[^1] (similar to PyTorch's unfold but in 1D/2D/3D/arbitrary dimensions)
      • Useful for local patch extraction
    • Interpolate[^1] (similar to SigPy's interpolate/gridding)
      • Comes with kaiser_bessel and (1D) spline kernels.
  • .H and .N properties for adjoint $A^H$ and normal $A^HA$ linop creation.
  • Chain and Add for composing linops together.
  • Batch and DistributedBatch wrappers for splitting linops temporally on a single GPU, or across multiple GPUs (via torch.multiprocessing).
  • Full support for complex numbers. Adjoint takes the conjugate transpose.
  • Full support for autograd-based automatic differentiation.

[^1]: Includes a functional interface and triton backend for 1D/2D/3D.

Installation

Via pip

$ pip install torch-named-linops

From source (recommended for developers)

  1. Clone the repo with git clone
  2. Run pip install -e . from the root directory.
  • Or uv add path/to/cloned/repo
  1. Pull upstream changes as required.

Via pip's git integration (deprecated)

Run the following, replacing <TAG> with the appropriate version (e.g. `0.3.7``)

  • http version:
$ pip install git+https://github.com/nishi951/torch-named-linops.git@<TAG>
  • ssh version:
$ pip install git+ssh://git@github.com/nishi951/torch-named-linops.git@<TAG>

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

torch_named_linops-0.3.19.tar.gz (166.4 kB view details)

Uploaded Source

Built Distribution

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

torch_named_linops-0.3.19-py3-none-any.whl (130.3 kB view details)

Uploaded Python 3

File details

Details for the file torch_named_linops-0.3.19.tar.gz.

File metadata

  • Download URL: torch_named_linops-0.3.19.tar.gz
  • Upload date:
  • Size: 166.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for torch_named_linops-0.3.19.tar.gz
Algorithm Hash digest
SHA256 bf3fb5054be01f27b7a37bf6b1fa1a6e8317998dd809b3f863f24428c21bda5b
MD5 1c27df889d00d075d2085be6ff9d3bf5
BLAKE2b-256 410a6a89222c3fbb0ca5f4cff11874ed6ae3e93265db73ec71ff21b0eec45d22

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_named_linops-0.3.19.tar.gz:

Publisher: release.yml on nishi951/torch-named-linops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_named_linops-0.3.19-py3-none-any.whl.

File metadata

File hashes

Hashes for torch_named_linops-0.3.19-py3-none-any.whl
Algorithm Hash digest
SHA256 f2014eb6edcbace524268a41df9f4495fc5914517f49c6b6eef6611886611d61
MD5 48d0db20e4a4842f1b601f5fbc3ddac6
BLAKE2b-256 a2e4c4d127042f8a82364b1664f4b6987d1bc6f8405276054cedc148474af8ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_named_linops-0.3.19-py3-none-any.whl:

Publisher: release.yml on nishi951/torch-named-linops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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