Why is the optimize argument False by default in np.einsum?

Viewed 67

Why is the default not optimize=True or one of the specific optimization options?

I'm asking this because as a user of course I want the most optimal computation by default.

1 Answers

In the docs of the numpy.einsum (which may be found here) it says that for using optimization may increase calculation of contractions with >3 elements. The speed improvement thought, comes in an expanse of memory usage, which will be used during the computation.

So basically it's left for the consideration of the user to decide if he has a sufficient memory footprint to use optimization, and to guarantee that the method will run on most of the devices, which may lack the necessary memory resources.

Cheers.

Related