Describe the bug
If a tensor shows up more than once in a tensor expression, then it will also show up as many times in Factorization.factors. This may lead to incorrect behavior during SGD should the same tensor gets updates multiple times during one step.
To Reproduce
import funfact as ff
a = ff.tensor('a', 4)
fac = ff.Factorization.from_tsrex(a * a)
print(fac.factors)
leads to
<'data' fields of tensors a, a>
Expected behavior
A tensor should only appear once in .factors regardless of how many times it is used in a tensor expression.
Describe the bug If a tensor shows up more than once in a tensor expression, then it will also show up as many times in
Factorization.factors
. This may lead to incorrect behavior during SGD should the same tensor gets updates multiple times during one step.To Reproduce
leads to
Expected behavior A tensor should only appear once in
.factors
regardless of how many times it is used in a tensor expression.