Which is a quick way to parallelize element-wise multiplication of 2D NumPy arrays?

爱⌒轻易说出口 提交于 2019-12-11 08:29:53

问题


I use a NumPy function einsum to perform element-wise multiplication of two 2D NumPy arrays and sum.

np.einsum('ij,ij',A,B)

Each of these array A, B are sized around 10000 x 10000. I notice this operation is the bottleneck in my code taking up ~85 % of the processing time. How do I quickly parallelize this operation?

来源:https://stackoverflow.com/questions/44888667/which-is-a-quick-way-to-parallelize-element-wise-multiplication-of-2d-numpy-arra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!