相关疑难解决方法(0)

"缓存中间结果"是什么意思?

我有一组n个向量存储在3 xn矩阵中z.我找到了外用产品np.einsum.当我使用时间计时:

%timeit v=np.einsum('i...,j...->ij...',z,z)
Run Code Online (Sandbox Code Playgroud)

我得到了结果:

The slowest run took 7.23 times longer than the fastest. This could mean that an
intermediate result is being cached 
100000 loops, best of 3: 2.9 µs per loop
Run Code Online (Sandbox Code Playgroud)

这里发生了什么,可以避免吗?最好的3是2.9us,但最慢可能更典型.

benchmarking numpy vectorization ipython

31
推荐指数
1
解决办法
4806
查看次数

标签 统计

benchmarking ×1

ipython ×1

numpy ×1

vectorization ×1