torch-einops-kit 0.1.9__tar.gz → 0.1.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. {torch_einops_kit-0.1.9/src/torch_einops_kit.egg-info → torch_einops_kit-0.1.10}/PKG-INFO +28 -21
  2. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/README.md +24 -11
  3. torch_einops_kit-0.1.10/pyproject.toml +287 -0
  4. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10/torch_einops_kit.egg-info}/PKG-INFO +28 -21
  5. torch_einops_kit-0.1.10/torch_einops_kit.egg-info/SOURCES.txt +40 -0
  6. torch_einops_kit-0.1.10/torch_einops_kit.egg-info/requires.txt +4 -0
  7. torch_einops_kit-0.1.9/pyproject.toml +0 -68
  8. torch_einops_kit-0.1.9/src/torch_einops_kit.egg-info/SOURCES.txt +0 -40
  9. torch_einops_kit-0.1.9/src/torch_einops_kit.egg-info/requires.txt +0 -12
  10. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/LICENSE +0 -0
  11. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/LICENSE-WANG +0 -0
  12. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/setup.cfg +0 -0
  13. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_cat_stack.py +0 -0
  14. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_device.py +0 -0
  15. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_device_extended.py +0 -0
  16. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_dimensions.py +0 -0
  17. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_einops.py +0 -0
  18. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_helpers.py +0 -0
  19. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_masking.py +0 -0
  20. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_nn.py +0 -0
  21. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_nn_extended.py +0 -0
  22. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_padding.py +0 -0
  23. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_save_load.py +0 -0
  24. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_save_load_extended.py +0 -0
  25. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_scaleValues.py +0 -0
  26. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_slicing.py +0 -0
  27. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_utils.py +0 -0
  28. {torch_einops_kit-0.1.9 → torch_einops_kit-0.1.10}/tests/test_utils_extended.py +0 -0
  29. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/__init__.py +0 -0
  30. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/_cat_and_stack.py +0 -0
  31. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/_dimensions.py +0 -0
  32. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/_helpers.py +0 -0
  33. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/_masking.py +0 -0
  34. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/_padding.py +0 -0
  35. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/_slicing.py +0 -0
  36. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/_theTypes.py +0 -0
  37. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/device.py +0 -0
  38. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/einops.py +0 -0
  39. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/nn.py +0 -0
  40. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/py.typed +0 -0
  41. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/save_load.py +0 -0
  42. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/scaleValues.py +0 -0
  43. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit/utils.py +0 -0
  44. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit.egg-info/dependency_links.txt +0 -0
  45. {torch_einops_kit-0.1.9/src → torch_einops_kit-0.1.10}/torch_einops_kit.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: torch-einops-kit
3
- Version: 0.1.9
3
+ Version: 0.1.10
4
4
  Summary: Typed tensor-shaping, masking, padding, device-routing, and checkpoint utilities for PyTorch and `einops`. A superset of `lucidrains/torch-einops-utils` with similar utilities from other lucidrains packages. Adds strict typing, extensive tests, and comprehensive docstrings.
5
5
  Author-email: Hunter Hogan <HunterHogan@pm.me>
6
6
  Maintainer-email: Hunter Hogan <HunterHogan@pm.me>
@@ -19,27 +19,22 @@ Classifier: Intended Audience :: Developers
19
19
  Classifier: Intended Audience :: Science/Research
20
20
  Classifier: Natural Language :: English
21
21
  Classifier: Operating System :: OS Independent
22
- Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
23
  Classifier: Programming Language :: Python :: 3.14
24
24
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
25
25
  Classifier: Topic :: Utilities
26
26
  Classifier: Typing :: Typed
27
- Requires-Python: >=3.10
27
+ Requires-Python: >=3.11
28
28
  Description-Content-Type: text/markdown
29
29
  License-File: LICENSE
30
30
  License-File: LICENSE-WANG
31
31
  Requires-Dist: einops>=0.8.2
32
32
  Requires-Dist: huntermakespy>=0.7.0
33
- Requires-Dist: torch>=2.0.0
33
+ Requires-Dist: torch>=2.6
34
34
  Requires-Dist: typing-extensions>=4.0.0
35
- Provides-Extra: development
36
- Requires-Dist: pytest-cov; extra == "development"
37
- Provides-Extra: testing
38
- Requires-Dist: more-itertools; extra == "testing"
39
- Requires-Dist: numpy>=2.0.0; extra == "testing"
40
- Requires-Dist: pytest; extra == "testing"
41
35
  Dynamic: license-file
42
36
 
37
+ <!-- path-sync copy -n hunterhogan -->
43
38
  # torch_einops_kit
44
39
 
45
40
  Typed tensor-shaping, masking, padding, device-routing, lightweight `nn.Module` adapters, and checkpoint utilities for PyTorch and `einops`.
@@ -59,7 +54,7 @@ Use `torch_einops_kit` when you want strict typing, a `py.typed` marker, focused
59
54
 
60
55
  - Project name: `torch_einops_kit`.
61
56
  - Import path: `torch_einops_kit`.
62
- - Python requirement: `>=3.10`.
57
+ - Python requirement: `>=3.11`.
63
58
  - Runtime dependencies: `torch`, `einops`, and `typing-extensions`.
64
59
  - Root package exports: helper functions, slicing helpers, rank-alignment helpers, mask helpers, safe concatenation helpers, padding helpers, normalization helpers, and PyTree / `einops` helpers.
65
60
  - Submodules with dedicated imports: `torch_einops_kit.device`, `torch_einops_kit.einops`, `torch_einops_kit.nn`, `torch_einops_kit.save_load`, and `torch_einops_kit.scaleValues`.
@@ -452,19 +447,25 @@ This repository is not a repackaged mirror of upstream. This repository makes a
452
447
 
453
448
  ## Repository layout
454
449
 
455
- - `src/torch_einops_kit/` — package source.
456
- - `src/torch_einops_kit/device.py` — device inference and input-routing decorators.
457
- - `src/torch_einops_kit/nn.py` — lightweight `torch.nn.Module` adapters and a `Sequential` constructor that ignores `None` modules.
458
- - `src/torch_einops_kit/save_load.py` — checkpoint save / load decorator and nested reconstruction helpers.
459
- - `src/torch_einops_kit/scaleValues.py` — exclusive and reverse cumulative sums, vector normalization, masked mean, and the `RMSNorm` layer.
450
+ - `torch_einops_kit/` — package source.
451
+ - `torch_einops_kit/device.py` — device inference and input-routing decorators.
452
+ - `torch_einops_kit/nn.py` — lightweight `torch.nn.Module` adapters and a `Sequential` constructor that ignores `None` modules.
453
+ - `torch_einops_kit/save_load.py` — checkpoint save / load decorator and nested reconstruction helpers.
454
+ - `torch_einops_kit/scaleValues.py` — exclusive and reverse cumulative sums, vector normalization, masked mean, and the `RMSNorm` layer.
460
455
  - `tests/` — regression tests and usage examples for helpers, masks, padding, device routing, and checkpoint reconstruction.
461
456
 
462
457
  ## Development
463
458
 
464
- Set up the repository:
459
+ Set up the repository. Installing dependency groups requires `pip>=25.1`. The `development` group includes the `testing` group:
465
460
 
466
461
  ```bash
467
- uv sync
462
+ pip install --editable . --group development
463
+ ```
464
+
465
+ To install only what the test suite needs, use the `testing` group:
466
+
467
+ ```bash
468
+ pip install --editable . --group testing
468
469
  ```
469
470
 
470
471
  Run the test suite:
@@ -479,9 +480,15 @@ Run static analysis:
479
480
  ruff check .
480
481
  ```
481
482
 
483
+ <!-- === DO_NOT_EDIT: path-sync hunterhogan === -->
482
484
  ## My recovery
483
485
 
484
- [![Static Badge](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
485
- [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UC3Gx7kz61009NbhpRtPP7tw)](https://www.youtube.com/@HunterHogan)
486
+ [![2011 August: Homeless since](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
487
+ ![License: CC BY-NC 4.0](https://img.shields.io/badge/license-CC%20BY--NC%204.0-blue.svg)
488
+
489
+ By law, authors retain their copyrights unless they grant exceptions. The Creative Commons Attribution-NonCommercial 4.0 International Deed outlines how you may use this work.
490
+
491
+ The restriction on commercial use (without a license) limits advantage-taking, unjust enrichment, and exploitation. You would be morally wrong if you were to enrich yourself by using this work while I am denied healthcare, housing, security of property, and the safety of my person.
486
492
 
487
- [![CC-BY-NC-4.0](https://raw.githubusercontent.com/hunterhogan/torch_einops_kit/refs/heads/main/.github/CC-BY-NC-4.0.png)](https://creativecommons.org/licenses/by-nc/4.0/)
493
+ To obtain and retain the right to use this work, you incur the cost of attributing the work to me. Your nominal cost might accrue as a benefit that mitigates my suffering or saves my life.
494
+ <!-- === OK_EDIT: path-sync hunterhogan === -->
@@ -1,3 +1,4 @@
1
+ <!-- path-sync copy -n hunterhogan -->
1
2
  # torch_einops_kit
2
3
 
3
4
  Typed tensor-shaping, masking, padding, device-routing, lightweight `nn.Module` adapters, and checkpoint utilities for PyTorch and `einops`.
@@ -17,7 +18,7 @@ Use `torch_einops_kit` when you want strict typing, a `py.typed` marker, focused
17
18
 
18
19
  - Project name: `torch_einops_kit`.
19
20
  - Import path: `torch_einops_kit`.
20
- - Python requirement: `>=3.10`.
21
+ - Python requirement: `>=3.11`.
21
22
  - Runtime dependencies: `torch`, `einops`, and `typing-extensions`.
22
23
  - Root package exports: helper functions, slicing helpers, rank-alignment helpers, mask helpers, safe concatenation helpers, padding helpers, normalization helpers, and PyTree / `einops` helpers.
23
24
  - Submodules with dedicated imports: `torch_einops_kit.device`, `torch_einops_kit.einops`, `torch_einops_kit.nn`, `torch_einops_kit.save_load`, and `torch_einops_kit.scaleValues`.
@@ -410,19 +411,25 @@ This repository is not a repackaged mirror of upstream. This repository makes a
410
411
 
411
412
  ## Repository layout
412
413
 
413
- - `src/torch_einops_kit/` — package source.
414
- - `src/torch_einops_kit/device.py` — device inference and input-routing decorators.
415
- - `src/torch_einops_kit/nn.py` — lightweight `torch.nn.Module` adapters and a `Sequential` constructor that ignores `None` modules.
416
- - `src/torch_einops_kit/save_load.py` — checkpoint save / load decorator and nested reconstruction helpers.
417
- - `src/torch_einops_kit/scaleValues.py` — exclusive and reverse cumulative sums, vector normalization, masked mean, and the `RMSNorm` layer.
414
+ - `torch_einops_kit/` — package source.
415
+ - `torch_einops_kit/device.py` — device inference and input-routing decorators.
416
+ - `torch_einops_kit/nn.py` — lightweight `torch.nn.Module` adapters and a `Sequential` constructor that ignores `None` modules.
417
+ - `torch_einops_kit/save_load.py` — checkpoint save / load decorator and nested reconstruction helpers.
418
+ - `torch_einops_kit/scaleValues.py` — exclusive and reverse cumulative sums, vector normalization, masked mean, and the `RMSNorm` layer.
418
419
  - `tests/` — regression tests and usage examples for helpers, masks, padding, device routing, and checkpoint reconstruction.
419
420
 
420
421
  ## Development
421
422
 
422
- Set up the repository:
423
+ Set up the repository. Installing dependency groups requires `pip>=25.1`. The `development` group includes the `testing` group:
423
424
 
424
425
  ```bash
425
- uv sync
426
+ pip install --editable . --group development
427
+ ```
428
+
429
+ To install only what the test suite needs, use the `testing` group:
430
+
431
+ ```bash
432
+ pip install --editable . --group testing
426
433
  ```
427
434
 
428
435
  Run the test suite:
@@ -437,9 +444,15 @@ Run static analysis:
437
444
  ruff check .
438
445
  ```
439
446
 
447
+ <!-- === DO_NOT_EDIT: path-sync hunterhogan === -->
440
448
  ## My recovery
441
449
 
442
- [![Static Badge](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
443
- [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UC3Gx7kz61009NbhpRtPP7tw)](https://www.youtube.com/@HunterHogan)
450
+ [![2011 August: Homeless since](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
451
+ ![License: CC BY-NC 4.0](https://img.shields.io/badge/license-CC%20BY--NC%204.0-blue.svg)
452
+
453
+ By law, authors retain their copyrights unless they grant exceptions. The Creative Commons Attribution-NonCommercial 4.0 International Deed outlines how you may use this work.
454
+
455
+ The restriction on commercial use (without a license) limits advantage-taking, unjust enrichment, and exploitation. You would be morally wrong if you were to enrich yourself by using this work while I am denied healthcare, housing, security of property, and the safety of my person.
444
456
 
445
- [![CC-BY-NC-4.0](https://raw.githubusercontent.com/hunterhogan/torch_einops_kit/refs/heads/main/.github/CC-BY-NC-4.0.png)](https://creativecommons.org/licenses/by-nc/4.0/)
457
+ To obtain and retain the right to use this work, you incur the cost of attributing the work to me. Your nominal cost might accrue as a benefit that mitigates my suffering or saves my life.
458
+ <!-- === OK_EDIT: path-sync hunterhogan === -->
@@ -0,0 +1,287 @@
1
+ # path-sync copy -n hunterhogan
2
+ [project]
3
+ name = "torch-einops-kit"
4
+ version = "0.1.10"
5
+ description = "Typed tensor-shaping, masking, padding, device-routing, and checkpoint utilities for PyTorch and `einops`. A superset of `lucidrains/torch-einops-utils` with similar utilities from other lucidrains packages. Adds strict typing, extensive tests, and comprehensive docstrings."
6
+ readme = "README.md"
7
+ requires-python = ">=3.11"
8
+ license = "CC-BY-NC-4.0"
9
+ license-files = ["LICEN[CS]E*"]
10
+ authors = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
11
+ maintainers = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
12
+ keywords = [
13
+ "artificial intelligence",
14
+ "einops",
15
+ "machine learning",
16
+ "pytorch",
17
+ "torch",
18
+ ]
19
+ classifiers = [
20
+ "Development Status :: 4 - Beta",
21
+ "Environment :: Console",
22
+ "Environment :: GPU :: NVIDIA CUDA",
23
+ "Intended Audience :: Developers",
24
+ "Intended Audience :: Science/Research",
25
+ "Natural Language :: English",
26
+ "Operating System :: OS Independent",
27
+ "Programming Language :: Python :: 3.11",
28
+ "Programming Language :: Python :: 3.14",
29
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
30
+ "Topic :: Utilities",
31
+ "Typing :: Typed",
32
+ ]
33
+ dependencies = [
34
+ "einops>=0.8.2",
35
+ "huntermakespy>=0.7.0",
36
+ "torch>=2.6",
37
+ "typing-extensions>=4.0.0",
38
+ ]
39
+
40
+ [project.urls]
41
+ Context7 = "https://context7.com/hunterhogan/torch_einops_kit"
42
+ Donate = "https://www.patreon.com/integrated"
43
+ Download = "https://pypi.org/project/torch_einops_kit"
44
+ Homepage = "https://github.com/hunterhogan/torch_einops_kit"
45
+ Issues = "https://github.com/hunterhogan/torch_einops_kit/issues"
46
+ Repository = "https://github.com/hunterhogan/torch_einops_kit.git"
47
+
48
+ [dependency-groups]
49
+ development = ["pytest-cov", { include-group = "testing" }]
50
+ testing = ["more-itertools", "numpy>=2.0.0", "pytest"]
51
+
52
+ [build-system]
53
+ requires = ["setuptools>=77.0.1"]
54
+ build-backend = "setuptools.build_meta"
55
+
56
+ [tool.coverage]
57
+ report = { ignore_errors = false }
58
+ run = { branch = true, data_file = "tests/coverage/.coverage", omit = ["tests/*"], source = ["."] }
59
+
60
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
61
+ [tool.isort]
62
+ add_imports = ["from __future__ import annotations"]
63
+ append_only = true
64
+ atomic = true
65
+ combine_as_imports = true
66
+ extend_skip_glob = ["*.pyi"]
67
+ filter_files = true
68
+ force_alphabetical_sort_within_sections = true
69
+ from_first = true
70
+ honor_noqa = true
71
+ indent = "\t"
72
+ line_length = 140
73
+ lines_after_imports = 1
74
+ lines_between_types = 0
75
+ multi_line_output = 4
76
+ no_sections = true
77
+ skip_gitignore = true
78
+ use_parentheses = true
79
+ # === OK_EDIT: path-sync hunterhogan ===
80
+
81
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
82
+ [tool.pyrefly]
83
+ enabled-ignores = ["pyrefly"]
84
+ # ignore-errors-in-generated-code = true
85
+ infer-with-first-use = false
86
+ preset = "strict"
87
+ python-platform = "all"
88
+ # === OK_EDIT: path-sync hunterhogan ===
89
+
90
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
91
+ [tool.pyrefly.errors]
92
+ bad-return = "warn"
93
+ invalid-yield = "warn"
94
+ # === OK_EDIT: path-sync hunterhogan ===
95
+
96
+ [tool.pytest]
97
+ addopts = ["--color=yes"]
98
+ log_auto_indent = "On"
99
+ testpaths = ["tests"]
100
+
101
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
102
+ [tool.ruff]
103
+ line-length = 140
104
+ # === OK_EDIT: path-sync hunterhogan ===
105
+
106
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
107
+ [tool.ruff.lint]
108
+ allowed-confusables = ["–", "’", "′", "×", "−", "∖", "∗", "∣", "∨", "∪", "∼", "⊗", "ℂ", "ℋ", "ℒ", "ℓ", "ℕ", "ℙ", "ℚ", "ℝ", "ℤ", "ℰ", "ℱ", "𝒪", "𝒮", "𝔼", "𝕀", "𝟙", "α", "Β", "γ", "ι", "Κ", "ν", "ο", "ρ", "σ"]
109
+ future-annotations = true
110
+ ignore = [
111
+ # ====== Linters ===========
112
+ "FIX", # flake8-fixme
113
+ "I", # isort
114
+ "N", # pep8-naming
115
+ "TD", # flake8-todos
116
+ # ====== complexity ========
117
+ "dict-index-missing-items",
118
+ "explicit-f-string-type-conversion",
119
+ "non-pep695-type-alias",
120
+ "redundant-numeric-union",
121
+ "static-join-to-f-string",
122
+ "unnecessary-literal-dict",
123
+ "useless-import-alias",
124
+ # ====== correctness =======
125
+ "unused-variable",
126
+ # ====== formatting ========
127
+ "bad-quotes-inline-string",
128
+ "blank-lines-after-function-or-class",
129
+ "blank-lines-top-level",
130
+ "docstring-tab-indentation",
131
+ "incorrect-blank-line-after-class",
132
+ "line-too-long",
133
+ "missing-newline-at-end-of-file",
134
+ "missing-trailing-comma",
135
+ "no-space-after-block-comment",
136
+ "tab-indentation",
137
+ "too-many-blank-lines",
138
+ # ====== pedantic ==========
139
+ "any-type",
140
+ "blanket-noqa",
141
+ "docstring-in-stub",
142
+ "docstring-missing-exception",
143
+ "docstring-missing-returns",
144
+ "docstring-missing-yields",
145
+ "if-else-block-instead-of-if-exp",
146
+ "incorrect-section-order",
147
+ "magic-value-comparison",
148
+ "missing-copyright-notice",
149
+ "missing-trailing-period",
150
+ "non-ascii-import-name",
151
+ "non-ascii-name",
152
+ "non-imperative-mood",
153
+ "redefined-loop-name",
154
+ "superfluous-else-continue",
155
+ "superfluous-else-return",
156
+ "too-many-arguments",
157
+ "too-many-branches",
158
+ "too-many-locals",
159
+ "too-many-nested-blocks",
160
+ "too-many-positional-arguments",
161
+ "too-many-public-methods",
162
+ "too-many-statements",
163
+ "typed-argument-default-in-stub",
164
+ "yoda-conditions",
165
+ # ====== restriction =======
166
+ "complex-structure",
167
+ # ====== security ==========
168
+ "subprocess-without-shell-equals-true",
169
+ "suspicious-pickle-import",
170
+ # ====== style =============
171
+ "snake-case-type-alias",
172
+ "type-name-incorrect-variance",
173
+ # ====== suspicious ========
174
+ "self-or-cls-assignment",
175
+ "subclass-builtin",
176
+ "unused-import",
177
+ "useless-else-on-loop",
178
+ ]
179
+ preview = true
180
+ select = ["ALL"]
181
+ extend-select = ["missing-terminal-punctuation", "undocumented-param", "undocumented-public-init"]
182
+ task-tags = ["DEVELOPMENT", "NOTE", "SEMIOTICS", "TODO"]
183
+ # === OK_EDIT: path-sync hunterhogan ===
184
+
185
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
186
+ [tool.ruff.lint.flake8-comprehensions]
187
+ allow-dict-calls-with-keyword-arguments = true
188
+ # === OK_EDIT: path-sync hunterhogan ===
189
+
190
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
191
+ [tool.ruff.lint.flake8-import-conventions]
192
+ banned-aliases = { altair = ["alt"], datetime = ["dt"], holoviews = ["hv"], matplotlib = ["mpl"], "matplotlib.pyplot" = ["plt"], networkx = ["nx"], numpy = ["np"], "numpy.typing" = ["npt"], optype = ["op"], pandas = ["pd"], panel = ["pn"], "plotly.express" = ["px"], polars = ["pl"], pyarrow = ["pa"], regex = ["re"], seaborn = ["sns"], tensorflow = ["tf"], tkinter = ["tk"], "xml.etree.ElementTree" = ["ET"] }
193
+ # === OK_EDIT: path-sync hunterhogan ===
194
+
195
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
196
+ [tool.ruff.lint.flake8-import-conventions.aliases]
197
+ "accelerate.utils.dataclasses" = "accelerate_dataclasses"
198
+ "fs.path" = "fs_path"
199
+ "gmpy2.bit_test" = "isBit1吗"
200
+ "gmpy2.is_even" = "isEven吗"
201
+ "gmpy2.is_odd" = "isOdd吗"
202
+ "humpy_cytoolz.assoc" = "associateKeyValue"
203
+ "humpy_cytoolz.curry" = "syntacticCurry"
204
+ "humpy_cytoolz.groupby" = "toolz_groupby"
205
+ "itertools.product" = "CartesianProduct"
206
+ "math.comb" = "nCr"
207
+ "more_itertools.all_unique" = "allUnique吗"
208
+ "regex" = "regex"
209
+ "scipy" = "scipy"
210
+ "sympy.binomial" = "sympy_binomial"
211
+ "sympy.catalan" = "sympy_catalan"
212
+ "sympy.functions.combinatorial.factorials.binomial" = "sympy_binomial"
213
+ "sympy.functions.combinatorial.numbers.catalan" = "sympy_catalan"
214
+ "sympy" = "sympy"
215
+ "torch.autograd.grad" = "torch_grad"
216
+ "torch.nn.functional" = "F"
217
+ "torch.nn.parallel.DistributedDataParallel" = "DDP"
218
+ numpy = "numpy"
219
+ pandas = "pandas"
220
+ polars = "polars"
221
+ re = "regex"
222
+ # === OK_EDIT: path-sync hunterhogan ===
223
+
224
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
225
+ [tool.ruff.lint.flake8-quotes]
226
+ inline-quotes = "single"
227
+ # === OK_EDIT: path-sync hunterhogan ===
228
+
229
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
230
+ [tool.ruff.lint.per-file-ignores]
231
+ "**/*_test.py" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
232
+ "**/conftest*.py" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
233
+ "**/test_*.py" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
234
+ "**/tests/**" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
235
+ # === OK_EDIT: path-sync hunterhogan ===
236
+
237
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
238
+ [tool.ruff.lint.pydocstyle]
239
+ convention = "numpy"
240
+ # === OK_EDIT: path-sync hunterhogan ===
241
+
242
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
243
+ [tool.ruff.format]
244
+ docstring-code-format = true
245
+ indent-style = "tab"
246
+ line-ending = "lf"
247
+ nested-string-quote-style = "preferred"
248
+ quote-style = "single"
249
+ skip-magic-trailing-comma = true
250
+ # === OK_EDIT: path-sync hunterhogan ===
251
+
252
+ [tool.setuptools]
253
+ packages = { find = { include = ["torch_einops_kit", "torch_einops_kit.*"], namespaces = false } }
254
+
255
+ [tool.setuptools.package-data]
256
+ torch_einops_kit = ["py.typed"]
257
+
258
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
259
+ [tool.tombi.format.rules]
260
+ line-ending = "lf"
261
+ # === OK_EDIT: path-sync hunterhogan ===
262
+
263
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
264
+ [tool.ty.analysis]
265
+ respect-type-ignore-comments = false
266
+ return-type-inference = "always"
267
+ # === OK_EDIT: path-sync hunterhogan ===
268
+
269
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
270
+ [tool.ty.environment]
271
+ extra-paths = ["./typings"]
272
+ python-platform = "all"
273
+ # === OK_EDIT: path-sync hunterhogan ===
274
+
275
+ # === DO_NOT_EDIT: path-sync hunterhogan ===
276
+ [tool.ty.rules]
277
+ blanket-ignore-comment = "error"
278
+ missing-override-decorator = "error"
279
+ missing-type-argument = "error"
280
+ possibly-missing-attribute = "warn" # Might annoy you: ty's docs say this rule produces many false positives.
281
+ possibly-unresolved-reference = "warn" # Might annoy you: ty's docs say this rule produces many false positives.
282
+ truthiness-test-of-none-union = "warn" # Might annoy you: flags `if value:` on `int | None` or `str | None` even when treating 0 or '' like None is deliberate.
283
+ # === OK_EDIT: path-sync hunterhogan ===
284
+
285
+ [tool.updateCitation]
286
+ filenameCitationDOTcff = "CITATION.cff"
287
+ pathFilenameCitationSSOT = "citations/CITATION.cff"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: torch-einops-kit
3
- Version: 0.1.9
3
+ Version: 0.1.10
4
4
  Summary: Typed tensor-shaping, masking, padding, device-routing, and checkpoint utilities for PyTorch and `einops`. A superset of `lucidrains/torch-einops-utils` with similar utilities from other lucidrains packages. Adds strict typing, extensive tests, and comprehensive docstrings.
5
5
  Author-email: Hunter Hogan <HunterHogan@pm.me>
6
6
  Maintainer-email: Hunter Hogan <HunterHogan@pm.me>
@@ -19,27 +19,22 @@ Classifier: Intended Audience :: Developers
19
19
  Classifier: Intended Audience :: Science/Research
20
20
  Classifier: Natural Language :: English
21
21
  Classifier: Operating System :: OS Independent
22
- Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
23
  Classifier: Programming Language :: Python :: 3.14
24
24
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
25
25
  Classifier: Topic :: Utilities
26
26
  Classifier: Typing :: Typed
27
- Requires-Python: >=3.10
27
+ Requires-Python: >=3.11
28
28
  Description-Content-Type: text/markdown
29
29
  License-File: LICENSE
30
30
  License-File: LICENSE-WANG
31
31
  Requires-Dist: einops>=0.8.2
32
32
  Requires-Dist: huntermakespy>=0.7.0
33
- Requires-Dist: torch>=2.0.0
33
+ Requires-Dist: torch>=2.6
34
34
  Requires-Dist: typing-extensions>=4.0.0
35
- Provides-Extra: development
36
- Requires-Dist: pytest-cov; extra == "development"
37
- Provides-Extra: testing
38
- Requires-Dist: more-itertools; extra == "testing"
39
- Requires-Dist: numpy>=2.0.0; extra == "testing"
40
- Requires-Dist: pytest; extra == "testing"
41
35
  Dynamic: license-file
42
36
 
37
+ <!-- path-sync copy -n hunterhogan -->
43
38
  # torch_einops_kit
44
39
 
45
40
  Typed tensor-shaping, masking, padding, device-routing, lightweight `nn.Module` adapters, and checkpoint utilities for PyTorch and `einops`.
@@ -59,7 +54,7 @@ Use `torch_einops_kit` when you want strict typing, a `py.typed` marker, focused
59
54
 
60
55
  - Project name: `torch_einops_kit`.
61
56
  - Import path: `torch_einops_kit`.
62
- - Python requirement: `>=3.10`.
57
+ - Python requirement: `>=3.11`.
63
58
  - Runtime dependencies: `torch`, `einops`, and `typing-extensions`.
64
59
  - Root package exports: helper functions, slicing helpers, rank-alignment helpers, mask helpers, safe concatenation helpers, padding helpers, normalization helpers, and PyTree / `einops` helpers.
65
60
  - Submodules with dedicated imports: `torch_einops_kit.device`, `torch_einops_kit.einops`, `torch_einops_kit.nn`, `torch_einops_kit.save_load`, and `torch_einops_kit.scaleValues`.
@@ -452,19 +447,25 @@ This repository is not a repackaged mirror of upstream. This repository makes a
452
447
 
453
448
  ## Repository layout
454
449
 
455
- - `src/torch_einops_kit/` — package source.
456
- - `src/torch_einops_kit/device.py` — device inference and input-routing decorators.
457
- - `src/torch_einops_kit/nn.py` — lightweight `torch.nn.Module` adapters and a `Sequential` constructor that ignores `None` modules.
458
- - `src/torch_einops_kit/save_load.py` — checkpoint save / load decorator and nested reconstruction helpers.
459
- - `src/torch_einops_kit/scaleValues.py` — exclusive and reverse cumulative sums, vector normalization, masked mean, and the `RMSNorm` layer.
450
+ - `torch_einops_kit/` — package source.
451
+ - `torch_einops_kit/device.py` — device inference and input-routing decorators.
452
+ - `torch_einops_kit/nn.py` — lightweight `torch.nn.Module` adapters and a `Sequential` constructor that ignores `None` modules.
453
+ - `torch_einops_kit/save_load.py` — checkpoint save / load decorator and nested reconstruction helpers.
454
+ - `torch_einops_kit/scaleValues.py` — exclusive and reverse cumulative sums, vector normalization, masked mean, and the `RMSNorm` layer.
460
455
  - `tests/` — regression tests and usage examples for helpers, masks, padding, device routing, and checkpoint reconstruction.
461
456
 
462
457
  ## Development
463
458
 
464
- Set up the repository:
459
+ Set up the repository. Installing dependency groups requires `pip>=25.1`. The `development` group includes the `testing` group:
465
460
 
466
461
  ```bash
467
- uv sync
462
+ pip install --editable . --group development
463
+ ```
464
+
465
+ To install only what the test suite needs, use the `testing` group:
466
+
467
+ ```bash
468
+ pip install --editable . --group testing
468
469
  ```
469
470
 
470
471
  Run the test suite:
@@ -479,9 +480,15 @@ Run static analysis:
479
480
  ruff check .
480
481
  ```
481
482
 
483
+ <!-- === DO_NOT_EDIT: path-sync hunterhogan === -->
482
484
  ## My recovery
483
485
 
484
- [![Static Badge](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
485
- [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UC3Gx7kz61009NbhpRtPP7tw)](https://www.youtube.com/@HunterHogan)
486
+ [![2011 August: Homeless since](https://img.shields.io/badge/2011_August-Homeless_since-blue?style=flat)](https://HunterThinks.com/support)
487
+ ![License: CC BY-NC 4.0](https://img.shields.io/badge/license-CC%20BY--NC%204.0-blue.svg)
488
+
489
+ By law, authors retain their copyrights unless they grant exceptions. The Creative Commons Attribution-NonCommercial 4.0 International Deed outlines how you may use this work.
490
+
491
+ The restriction on commercial use (without a license) limits advantage-taking, unjust enrichment, and exploitation. You would be morally wrong if you were to enrich yourself by using this work while I am denied healthcare, housing, security of property, and the safety of my person.
486
492
 
487
- [![CC-BY-NC-4.0](https://raw.githubusercontent.com/hunterhogan/torch_einops_kit/refs/heads/main/.github/CC-BY-NC-4.0.png)](https://creativecommons.org/licenses/by-nc/4.0/)
493
+ To obtain and retain the right to use this work, you incur the cost of attributing the work to me. Your nominal cost might accrue as a benefit that mitigates my suffering or saves my life.
494
+ <!-- === OK_EDIT: path-sync hunterhogan === -->
@@ -0,0 +1,40 @@
1
+ LICENSE
2
+ LICENSE-WANG
3
+ README.md
4
+ pyproject.toml
5
+ tests/test_cat_stack.py
6
+ tests/test_device.py
7
+ tests/test_device_extended.py
8
+ tests/test_dimensions.py
9
+ tests/test_einops.py
10
+ tests/test_helpers.py
11
+ tests/test_masking.py
12
+ tests/test_nn.py
13
+ tests/test_nn_extended.py
14
+ tests/test_padding.py
15
+ tests/test_save_load.py
16
+ tests/test_save_load_extended.py
17
+ tests/test_scaleValues.py
18
+ tests/test_slicing.py
19
+ tests/test_utils.py
20
+ tests/test_utils_extended.py
21
+ torch_einops_kit/__init__.py
22
+ torch_einops_kit/_cat_and_stack.py
23
+ torch_einops_kit/_dimensions.py
24
+ torch_einops_kit/_helpers.py
25
+ torch_einops_kit/_masking.py
26
+ torch_einops_kit/_padding.py
27
+ torch_einops_kit/_slicing.py
28
+ torch_einops_kit/_theTypes.py
29
+ torch_einops_kit/device.py
30
+ torch_einops_kit/einops.py
31
+ torch_einops_kit/nn.py
32
+ torch_einops_kit/py.typed
33
+ torch_einops_kit/save_load.py
34
+ torch_einops_kit/scaleValues.py
35
+ torch_einops_kit/utils.py
36
+ torch_einops_kit.egg-info/PKG-INFO
37
+ torch_einops_kit.egg-info/SOURCES.txt
38
+ torch_einops_kit.egg-info/dependency_links.txt
39
+ torch_einops_kit.egg-info/requires.txt
40
+ torch_einops_kit.egg-info/top_level.txt
@@ -0,0 +1,4 @@
1
+ einops>=0.8.2
2
+ huntermakespy>=0.7.0
3
+ torch>=2.6
4
+ typing-extensions>=4.0.0
@@ -1,68 +0,0 @@
1
- [project]
2
- name = "torch-einops-kit"
3
- version = "0.1.9"
4
- description = "Typed tensor-shaping, masking, padding, device-routing, and checkpoint utilities for PyTorch and `einops`. A superset of `lucidrains/torch-einops-utils` with similar utilities from other lucidrains packages. Adds strict typing, extensive tests, and comprehensive docstrings."
5
- readme = "README.md"
6
- requires-python = ">=3.10"
7
- license = "CC-BY-NC-4.0"
8
- license-files = ["LICEN[CS]E*"]
9
- authors = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
10
- maintainers = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
11
- keywords = [
12
- "artificial intelligence",
13
- "einops",
14
- "machine learning",
15
- "pytorch",
16
- "torch",
17
- ]
18
- classifiers = [
19
- "Development Status :: 4 - Beta",
20
- "Environment :: Console",
21
- "Environment :: GPU :: NVIDIA CUDA",
22
- "Intended Audience :: Developers",
23
- "Intended Audience :: Science/Research",
24
- "Natural Language :: English",
25
- "Operating System :: OS Independent",
26
- "Programming Language :: Python :: 3.10",
27
- "Programming Language :: Python :: 3.14",
28
- "Topic :: Scientific/Engineering :: Artificial Intelligence",
29
- "Topic :: Utilities",
30
- "Typing :: Typed",
31
- ]
32
- dependencies = [
33
- "einops>=0.8.2",
34
- "huntermakespy>=0.7.0",
35
- "torch>=2.0.0",
36
- "typing-extensions>=4.0.0",
37
- ]
38
-
39
- [project.urls]
40
- Context7 = "https://context7.com/hunterhogan/torch_einops_kit"
41
- Donate = "https://www.patreon.com/integrated"
42
- Download = "https://pypi.org/project/torch_einops_kit"
43
- Homepage = "https://github.com/hunterhogan/torch_einops_kit"
44
- Issues = "https://github.com/hunterhogan/torch_einops_kit/issues"
45
- Repository = "https://github.com/hunterhogan/torch_einops_kit.git"
46
-
47
- [project.optional-dependencies]
48
- development = ["pytest-cov"]
49
- testing = ["more-itertools", "numpy>=2.0.0", "pytest"]
50
-
51
- [build-system]
52
- requires = ["setuptools"]
53
- build-backend = "setuptools.build_meta"
54
-
55
- [tool.coverage]
56
- report = { ignore_errors = false }
57
- run = { branch = true, data_file = "tests/coverage/.coverage", omit = [
58
- "tests/*"
59
- ], source = ["."] }
60
-
61
- [tool.pytest]
62
- addopts = ["--color=yes"]
63
- log_auto_indent = "On"
64
- testpaths = ["tests"]
65
-
66
- [tool.updateCitation]
67
- filenameCitationDOTcff = "CITATION.cff"
68
- pathFilenameCitationSSOT = "citations/CITATION.cff"
@@ -1,40 +0,0 @@
1
- LICENSE
2
- LICENSE-WANG
3
- README.md
4
- pyproject.toml
5
- src/torch_einops_kit/__init__.py
6
- src/torch_einops_kit/_cat_and_stack.py
7
- src/torch_einops_kit/_dimensions.py
8
- src/torch_einops_kit/_helpers.py
9
- src/torch_einops_kit/_masking.py
10
- src/torch_einops_kit/_padding.py
11
- src/torch_einops_kit/_slicing.py
12
- src/torch_einops_kit/_theTypes.py
13
- src/torch_einops_kit/device.py
14
- src/torch_einops_kit/einops.py
15
- src/torch_einops_kit/nn.py
16
- src/torch_einops_kit/py.typed
17
- src/torch_einops_kit/save_load.py
18
- src/torch_einops_kit/scaleValues.py
19
- src/torch_einops_kit/utils.py
20
- src/torch_einops_kit.egg-info/PKG-INFO
21
- src/torch_einops_kit.egg-info/SOURCES.txt
22
- src/torch_einops_kit.egg-info/dependency_links.txt
23
- src/torch_einops_kit.egg-info/requires.txt
24
- src/torch_einops_kit.egg-info/top_level.txt
25
- tests/test_cat_stack.py
26
- tests/test_device.py
27
- tests/test_device_extended.py
28
- tests/test_dimensions.py
29
- tests/test_einops.py
30
- tests/test_helpers.py
31
- tests/test_masking.py
32
- tests/test_nn.py
33
- tests/test_nn_extended.py
34
- tests/test_padding.py
35
- tests/test_save_load.py
36
- tests/test_save_load_extended.py
37
- tests/test_scaleValues.py
38
- tests/test_slicing.py
39
- tests/test_utils.py
40
- tests/test_utils_extended.py
@@ -1,12 +0,0 @@
1
- einops>=0.8.2
2
- huntermakespy>=0.7.0
3
- torch>=2.0.0
4
- typing-extensions>=4.0.0
5
-
6
- [development]
7
- pytest-cov
8
-
9
- [testing]
10
- more-itertools
11
- numpy>=2.0.0
12
- pytest