Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Pyrefly einops shape stubs

This package installs einops-shape-stubs, a Pyrefly-specific stub package for runtime einops. Pyrefly discovers it by default; set use-shape-comments-and-stubs = false to opt out. Other type checkers ignore these stubs and continue using einops's ordinary types.

It provides shape-aware annotations for rearrange, reduce, repeat, and einsum using Pyrefly's type-level shape DSL. The einops.layers.torch Rearrange and Reduce modules preserve the constructor pattern and axis lengths across calls.

The precise annotations target PyTorch, NumPy, and JAX. Shape computations are shared; backend overloads describe their different result types. NumPy rearrange and repeat preserve ndarray and its dtype. NumPy reductions and einsum may return array scalars, so their result protocol preserves shape and array conversion without promising ndarray or a dtype that reductions may promote. The precise NumPy reduction and einsum overloads cover numeric and boolean dtypes; object-dtype operations can return arbitrary Python objects and use the gradual fallback.

Backend shape stubs are optional dependencies: install the torch, numpy, or jax extra, or combine them as [torch,numpy,jax]. The base package does not install an array library. Install matching shape stubs for each of these backends present in your environment. Existing Torch users upgrading from the base package must add [torch] to retain Torch shape stubs.

Shape precision with optional backends requires Pyrefly's missing-import overload preference. It favors resolved input contracts without adding call warnings, while preserving return-only recovery and ordinary ambiguity for gradual arguments. Do not configure replace-imports-with-any or ignore-missing-imports for absent backends: those settings erase the provenance of unavailable annotations.

Literal axes_lengths keyword arguments are carried into the shape rules, so named input splits and repeated output axes remain tracked. Dynamically unpacked mappings preserve the known rank but use gradual dimensions for unknown axis lengths.

Run the static tests with:

python3 tensor-shapes/pyrefly-einops-stubs/run_pyrefly.py --buck
python3 tensor-shapes/pyrefly-einops-stubs/run_optional_backends.py --pyrefly /path/to/pyrefly

Metadata

Release files for pyrefly-einops-stubs 1.6.0.dev1

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

Source distribution (sdist)

Source distribution for pyrefly-einops-stubs 1.6.0.dev1
File Size Uploaded Provenance Actions
pyrefly_einops_stubs-1.6.0.dev1.tar.gz 4.3 kB With provenance Details for pyrefly_einops_stubs-1.6.0.dev1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyrefly-einops-stubs 1.6.0.dev1
File Interpreter ABI Platform Actions
pyrefly_einops_stubs-1.6.0.dev1-py3-none-any.whl Python 3 none any Details for pyrefly_einops_stubs-1.6.0.dev1-py3-none-any.whl

Total release size: 11.0 kB

Release files / pyrefly_einops_stubs-1.6.0.dev1.tar.gz

Download URL pyrefly_einops_stubs-1.6.0.dev1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8a350b9c344e0a8e15b8e31544c40499ececeb8651c25d7b48b15715df3845f5
BLAKE2b-256 checksum
How to use checksums
0a4ea1d7e82829a2a0c829f02d32f250c54ce9e8868366f43eb1eb210484d89d
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 Nov 21, 2026.

Transparency log

Release files / pyrefly_einops_stubs-1.6.0.dev1-py3-none-any.whl

Download URL pyrefly_einops_stubs-1.6.0.dev1-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd129c9845d7510396be726c9bdaa0f2c2a8249e2ceb60eca16043edfc2c8083
BLAKE2b-256 checksum
How to use checksums
2d9e08994e6a478026585869a92d9fbe6878e705587a1fb67ba0eb731ae2d194
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 Nov 21, 2026.

Transparency log

Security for pyrefly-einops-stubs 1.6.0.dev1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyrefly_einops_stubs-1.6.0.dev1.tar.gz

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

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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