Registry / ai-ml / fancy-einsum

fancy-einsum

JSON →
library0.0.3pypypi✓ verified 85d ago

A drop-in replacement for torch/numpy einsum that allows descriptive variable names in equations. Current version 0.0.3. Infrequently updated; released in 2021.

pip install fancy-einsum
INSTALL
IMPORT
SIG · FANCY-EINSUM
F
fancy-einsum
ai-mlpythonv0.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

einsum
✓ from fancy_einsum import einsum
✗ from fancy_einsum import fancy_einsum
get_backend
✓ from fancy_einsum import get_backend
convert_equation
✓ from fancy_einsum import convert_equation

Einstein summation with descriptive axis names instead of letters.

import torch from fancy_einsum import fancy_einsum x = torch.randn(3, 4) y = torch.randn(4, 5) # Using descriptive names: 'batch seq' -> 'batch hidden' z = fancy_einsum('batch seq, seq hidden -> batch hidden', x, y) print(z.shape) # torch.Size([3, 5])
Debug
Known issues
gotchaVariable names must be separated by spaces; repeated names imply contraction.
fix
Ensure spaces between names and that contraction axes use the same name.
affects: all
gotchaDoes not support ellipsis (...) for batch dimensions; use explicit names.
fix
Replace '...' with explicit dimension names like 'batch'.
affects: all
deprecatedLibrary is not actively maintained; last release May 2021. May not support newer PyTorch versions.
fix
Consider using einops.einsum with named axes or torch.einsum with named tensors.
affects: >=0.0.3
Upgrade
Version history
0.0.3latest on PyPI · released Feb 4, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
fancy-einsum — pip install fancy-einsum · libregistry