Drop-in replacement for torch/numpy einsum, with descriptive variable names in equations
Project description
Fancy Einsum
This is a simple wrapper around np.einsum
and torch.einsum
that allows the use of self-documenting variable names instead of just single letters in the equations. Inspired by the syntax in einops.
For example, instead of writing:
import torch
torch.einsum('bct,bcs->bcts', a, b)
or
import numpy as np
np.einsum('bct,bcs->bcts', a, b)
With this library you can write:
from fancy_einsum import einsum
einsum('batch channels time1, batch channels time2 -> batch channels time1 time2', a, b)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fancy_einsum-0.0.3.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for fancy_einsum-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0bf33587a61822b0668512ada237a0ffa5662adfb9acfcbb0356ee15a0396a1 |
|
MD5 | dc3d6479cd4a10dd6e23ba3212660cff |
|
BLAKE2b-256 | 271426fc262ba70976eea9a42e67b05c67aa78a0ee38332d9d094cca5d2c5ec3 |