You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I mostly use this lib for tensor computing, and I find it really useful. However, I find that I always need to write several lines of code to implement a simple idea. One example is tensor the product (Kronecker product).
import torch
import einops
a=torch.randn(32,32)
b = einops.einsum(a, a, 'b c, d e -> (b d) (c e)' )
# NotImplementedError: Shape rearrangement is not yet supported in einsum.
# I have to write something like this
b = einops.rearrange(einops.einsum(a, a, 'b c, d e -> b d c e' ), 'b d c e -> (b d) (c e)')
wher I compute b as the kronecker product of a: $b= a\otimes a$, and I feel this is unnecessarily complicated. I think it would be wonderful if rearrange is supported in einsum.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I mostly use this lib for tensor computing, and I find it really useful. However, I find that I always need to write several lines of code to implement a simple idea. One example is tensor the product (Kronecker product).
wher I compute b as the kronecker product of a:$b= a\otimes a$ , and I feel this is unnecessarily complicated. I think it would be wonderful if rearrange is supported in einsum.
Beta Was this translation helpful? Give feedback.
All reactions