Open
Description
Description
When Einsum can't be optimized (because we don't know the static shapes) it stays as an OpFromGraph. We could replace it by a COp (as a cxx_only rewrite) in this case, that calls the numpy C function:
https://numpy.org/devdocs/reference/c-api/array.html#c.PyArray_EinsteinSum
pytensor/pytensor/tensor/rewriting/einsum.py
Lines 39 to 53 in f25a624