gpt4 book ai didi

python - numba 中的 jit 和 autojit 有什么区别?

转载 作者:太空狗 更新时间:2023-10-29 20:20:04 27 4
gpt4 key购买 nike

我对 jitautojit 之间的区别感到困惑。

我读过这个:

http://numba.pydata.org/numba-doc/0.6/doc/userguide.html

但不能说我知道有信心在这两个选项之间做出选择。有人可以详细说明吗,最好是举个例子。

谢谢

最佳答案

我应该读过这篇适用于较新版本的 numba 的文章。

http://numba.pydata.org/numba-doc/0.15.1/tutorial_firststeps.html#compiling-a-function-with-numba-jit-using-an-explicit-function-signature

2) jit(函数) -> 调度器

Same as old autojit.  Create a dispatcher function object that
specialize at call site.

Example:

@jit
def foo(x, y):
return x + y

http://numba.pydata.org/numba-doc/0.15.1/tutorial_firststeps.html#compiling-a-function-without-providing-a-function-signature-autojit-functionality

Starting with numba version 0.12, it is possible to use numba.jit without providing a type-signature for the function. This functionality was provided by numba.autojit in previous versions of numba. The old numba.autojit hass been deprecated in favour of this signature-less version of numba.jit.

关于python - numba 中的 jit 和 autojit 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27434006/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com