小编sud*_*udo的帖子

将 line_profiler 与 numba jitted 函数一起使用

是否可以将 line_profiler 与 Numba 一起使用?

调用%lprun装饰的函数会@numba.jit返回一个空的配置文件:

Timer unit: 1e-06 s

Total time: 0 s
File: <ipython-input-29-486f0a3cdf73>
Function: conv at line 1

Line #      Hits         Time  Per Hit   % Time  Line Contents
==============================================================
     1                                           @numba.jit
     2                                           def conv(f, w):
     3                                               f_full = np.zeros(np.int(f.size + (2 * w.size) - 2), dtype=np.float64)
     4                                               for i in range(0, f_full.size):
     5                                                   if i >= w.size - 1 and i < w.size + f.size - 1:
     6                                                       f_full[i] = f[i - w.size …
Run Code Online (Sandbox Code Playgroud)

python performance profiling numba line-profiler

9
推荐指数
1
解决办法
1950
查看次数

标签 统计

line-profiler ×1

numba ×1

performance ×1

profiling ×1

python ×1