By defining the right helper types, we could make
Equivalent to F.dot(X, Y, ('j', 'i')) which could help readability.
We can also make a renaming syntax:
which is equivalent to X.rename(j='i').
Note the extra - in the string above, which disambiguates it from X-'j-i' which would be part of a contraction.
Other alternatives
- A simpler idea would be adding the syntax
dot(X, 'j', 'i,' Y) as an alternative to the current dot syntax derived from PyTorch.
- If the motivation is just easier "matrix like" algebra, we could also add the option for left/right co/contra variant edges...
- We already have the graph notation,
F.graph('X -j-i- Y', X=X, Y=Y) which is arguably the most flexible and direct.
By defining the right helper types, we could make
Equivalent to
F.dot(X, Y, ('j', 'i'))which could help readability.We can also make a renaming syntax:
which is equivalent to
X.rename(j='i').Note the extra
-in the string above, which disambiguates it fromX-'j-i'which would be part of a contraction.Other alternatives
dot(X, 'j', 'i,' Y)as an alternative to the current dot syntax derived from PyTorch.F.graph('X -j-i- Y', X=X, Y=Y)which is arguably the most flexible and direct.