semiring-einsum icon indicating copy to clipboard operation
semiring-einsum copied to clipboard

More than 26 indices?

Open davidweichiang opened this issue 2 years ago • 3 comments

torch.einsum limits you to 26 indices but can semiring_einsum provide a non-string interface that allows more than 26?

davidweichiang avatar Dec 01 '22 18:12 davidweichiang

That would be a good idea. How about something like:

compile_equation('abc,cde->bd')

can be written as

compile_equation(inputs=[['a', 'b', 'c'], ['c', 'd', 'e']], output=['b', 'd'])

or

compile_equation(inputs=[[0, 1, 2], [2, 3, 4]], output=[1, 3])

bdusell avatar Dec 01 '22 18:12 bdusell

That looks good to me. It's pretty close to numpy.einsum's alternative interface.

davidweichiang avatar Dec 01 '22 20:12 davidweichiang

Indeed, Python's common sequence operations make it easy to support

inputs=[['a', 'b', 'c'], ['c', 'd', 'e']], output=['b', 'd']

and

inputs=["abc", "cde"], output="bd"

with the same code.

ccshan avatar Feb 20 '23 23:02 ccshan