dgasmith / opt_einsum

⚡️Optimizing einsum functions in NumPy, Tensorflow, Dask, and more with contraction order optimization.
https://dgasmith.github.io/opt_einsum/
MIT License
863 stars 68 forks source link

Add Aesara as a backend #213

Open rlouf opened 1 year ago

rlouf commented 1 year ago

I am a core member of Aesara, a fork of the now deprecated Theano. Since there is a Theano backend, do you think it would make sense to have an Aesara backend as well?

dgasmith commented 1 year ago

@rlouf Absolutely, always happy to review PRs!

jcmgray commented 1 year ago

Yes it would certiainly be nice to have, I'll just note the requirements are pretty simple:

jcmgray commented 1 year ago

Possibly relevant question @rlouf, what is the best way to get the shape of a TensorType as a plain tuple of int? They don't have an infer_shape method. Is t.shape.eval() the way to go?

rlouf commented 1 year ago

You can try t.type.shape if the shape is known before evaluating the graph. The reason you don't get a tuple of int immediately is that in most cases the shape is not known before evaluating the graph with the inputs; t.type.shape will give you a tuple with int when the dimension is known and None otherwise.