{"id":15020429,"url":"https://github.com/nicholas-miklaucic/eins","last_synced_at":"2026-02-05T14:09:36.929Z","repository":{"id":233193327,"uuid":"771803493","full_name":"nicholas-miklaucic/eins","owner":"nicholas-miklaucic","description":"One tensor operation is all you need","archived":false,"fork":false,"pushed_at":"2024-04-24T01:29:44.000Z","size":3046,"stargazers_count":3,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-26T15:57:39.894Z","etag":null,"topics":["array","deep-learning","einops","jax","numpy","python"],"latest_commit_sha":null,"homepage":"https://nicholas-miklaucic.github.io/eins/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicholas-miklaucic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-14T01:20:59.000Z","updated_at":"2025-10-16T01:51:16.000Z","dependencies_parsed_at":"2024-04-24T02:46:00.168Z","dependency_job_id":null,"html_url":"https://github.com/nicholas-miklaucic/eins","commit_stats":null,"previous_names":["nicholas-miklaucic/eins"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nicholas-miklaucic/eins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholas-miklaucic%2Feins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholas-miklaucic%2Feins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholas-miklaucic%2Feins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholas-miklaucic%2Feins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicholas-miklaucic","download_url":"https://codeload.github.com/nicholas-miklaucic/eins/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicholas-miklaucic%2Feins/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29123643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T14:05:12.718Z","status":"ssl_error","status_checked_at":"2026-02-05T14:03:53.078Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","deep-learning","einops","jax","numpy","python"],"created_at":"2024-09-24T19:55:04.738Z","updated_at":"2026-02-05T14:09:36.913Z","avatar_url":"https://github.com/nicholas-miklaucic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eins\n\n## One tensor operation is all you need\n\n[![PyPI - Version](https://img.shields.io/pypi/v/eins.svg)](https://pypi.org/project/eins)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/eins.svg)](https://pypi.org/project/eins)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)\n\nWhat if most of your machine learning model code could be replaced by a single operation? Eins gives\nyou a powerful language to describe array manipulation, making it a one-stop shop for all of your AI\nneeds.\n\nLet's say you want to compute batched pairwise distance between two batches of arrays of points:\n\n```python\nfrom eins import EinsOp\nEinsOp('batch n1 d, batch n2 d -\u003e batch n1 n2',\n       combine='add', reduce='l2_norm')(pts1, -pts2)\n```\n\nIf you're more interested in deep learning, here is [the patch embedding from a vision\ntransformer](https://nn.labml.ai/transformers/vit/index.html#PatchEmbeddings). That means breaking\nup an image into patches and then linearly embedding each patch.\n\n```python\nfrom eins import EinsOp\npatchify = EinsOp('''b (n_p patch) (n_p patch) c, (patch patch c) emb -\u003e b (n_p n_p) emb''')\npatches = patchify(images, kernel)\n```\n\nYou input the shapes and Eins will figure out what to do.\n\nIf you've used [`einops`](https://github.com/arogozhnikov/einops), then think of Eins as `einops`\nwith a more ambitious goal—being the only operation you should need for your next deep learning\nproject.\n\nInterested? Check out the [tutorial](https://nicholas-miklaucic.github.io/eins/tutorial/), which\nwalks you through the highlights of Eins with examples of how Eins can make the array operations you\nknow and love more readable, portable, and robust.\n\nTo learn more, consult the [documentation](https://nicholas-miklaucic.github.io/eins/) or\nthe [examples](examples/README.md).\n\n## Installation\n\n```console\npip install eins\n```\n\nEins works with anything that implements the [Array\nAPI](https://data-apis.org/array-api/latest/index.html), and Eins explicitly promises to support\nNumPy, PyTorch, and JAX—including full differentiability. You will need one of those libraries to\nactually use Eins operations.\n\n## Features\n\n- 🧩 A solver that can handle duplicate axes, named constants, and constraints\n- 🚀 Compilation and optimization for high performance without sacrificing readability\n- Split, concatenate, stack, flatten, transpose, normalize, reduce, broadcast, and more\n- Works across frameworks\n- A composable set of unified array operations for portable softmax, power normalization, and more\n\n## Roadmap\n\nEins is still in heavy development. Here's a sense of where we're headed.\n\n### Near-Term (weeks)\n\n- [ ] Updating indexing syntax to match `eindex`\n- [x] Unit array to indicate zero-dimensional tensors\n- [ ] `...` for batching over dynamic numbers of batch axes\n- [ ] Specifying intermediate results to control the order of reduction\n- [ ] Support `-` and `/`\n- [ ] Better error reporting\n- [ ] Ways of visualizing and inspecting the computation graph\n- [ ] Typo checking in errors about axes\n- [ ] Multiple outputs, either through arrows or commas\n\n### Long-Term (months)\n\n- [ ] Layers for popular ML frameworks\n- [ ] Automatically optimizing the execution of a specific EinsOp for a specific\n      computer and input size\n- [ ] Completing full support for tensor indexing\n- [ ] Static typing support\n- [ ] Tabulating the model FLOPs/memory usage as a function of named axes\n- [ ] Functionality akin to `pack` and `unpack`\n\n## Acknowledgements\n\nThe excellent [`einops`](https://github.com/arogozhnikov/einops) library\ninspired this project and its syntax. After working on my own extension to\nhandle indexing, I realized that\n[`eindex`](https://github.com/arogozhnikov/eindex) already had a more coherent\nvision for what indexing can look like, and so much of that syntax in this\nlibrary borrows from that one.\n\n## Contributing\n\nAny contributions to Eins are welcomed and appreciated! If you're interested\nin making serious changes or extensions to the syntax of operations, consider\nreaching out first to make sure we're on the same page. For any code changes, do\nmake sure you're using the project Ruff settings.\n\n## License\n\nEins is distributed under the terms of the\n[MIT](https://spdx.org/licenses/MIT.html) license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholas-miklaucic%2Feins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicholas-miklaucic%2Feins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholas-miklaucic%2Feins/lists"}