yhtang / FunFact

Tensor decomposition with arbitrary expressions: inner, outer, elementwise operators; nonlinear transformations; and more.
Other
57 stars 4 forks source link

[BUG] Tensor transposition #217

Closed campsd closed 2 years ago

campsd commented 2 years ago

Describe the bug Transposition of individual tensors is failing. The root cause appears to be that this not implemented in the einop_compiler.

To Reproduce

a = ff.tensor('a', 2, 3, 4, 5)
i, j, k, l = ff.indices('i j k l')
tsrex = a[i, j, k, l] >> [l, i, j, k]
fac = ff.Factorization.from_tsrex(tsrex)
fac()
# >>> TypeError: tran() missing 1 required positional argument: 'einspec'

Expected behavior Tensor a should be transposed.