opt_einsum icon indicating copy to clipboard operation
opt_einsum copied to clipboard

Add Aesara as a backend

Open rlouf opened this issue 2 years ago • 4 comments

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?

rlouf avatar Feb 04 '23 22:02 rlouf

@rlouf Absolutely, always happy to review PRs!

dgasmith avatar Feb 12 '23 21:02 dgasmith

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

  • [x] ability to dynamically define high dimensional tensors.
  • [x] tensordot implementation
  • [ ] (optional) einsum implementation -- without this only some contractions can be performed

jcmgray avatar Feb 13 '23 03:02 jcmgray

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?

jcmgray avatar Feb 17 '23 01:02 jcmgray

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.

rlouf avatar Feb 17 '23 06:02 rlouf