0

What is the optimization scheme of numpy.einsum ? Does it optimize the memory consumption or the CPU or anything else ?

I don't see this discussed anywhere. Maybe it's related to the different ‘optimize’ options, that I don't understand

hpaulj
  • 221,503
  • 14
  • 230
  • 353
Stéphane
  • 1,389
  • 3
  • 13
  • 34
  • Personally my experience and experience of my group mates says "Never to use np.einsum, because it is too slow. Just use element-wise operations and multiplication of matrices." – CrafterKolyan Jun 08 '19 at 21:55
  • Mostly it has to do with evaluation order when using 3 or more variables and complex combinations of indices. Look at `einsum_path` docs. – hpaulj Jun 09 '19 at 04:06
  • 1
    Give a sample of the kinds of calculations you are using it for. – hpaulj Jun 09 '19 at 04:11
  • In general `np.einsum` is faster than element-wise operations for simple operations. Use `optimize=True` if you have GEMM's. – Daniel Jun 25 '19 at 18:33

0 Answers0