You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide explicit function signatures for numba #45
On my system, numba is crashing Python when @njit-decorated functions are called. The problem disappears when explicit function signatures are provided to @njit. Should we provides these?
Like Julia, numba can take advantage of multiple dispatch. This means I can njit function without specifying the type and it will work on several different types.
But once you specify a signature you can only use types of that signature.
@njit(''i8(i8)')defmyfunc(inp):
returninpprint(myfunc(10)) # -> 10print(myfunc('10')) # -> TypeError: No matching definition for argument type(s) unicode_type
This is useful because it allows njit functions to be more dynamic. If I specify signatures, then I would need to specify all possible signatures if I want to maintain this functionality. In your specific case, using multiple signatures may not fix the crashing problem, so it may not even be worth it.
Activity
mtessmer commentedon Jan 6, 2023
Like Julia, numba can take advantage of multiple dispatch. This means I can
njitfunction without specifying the type and it will work on several different types.But once you specify a signature you can only use types of that signature.
This is useful because it allows
njitfunctions to be more dynamic. If I specify signatures, then I would need to specify all possible signatures if I want to maintain this functionality. In your specific case, using multiple signatures may not fix the crashing problem, so it may not even be worth it.mtessmer commentedon Apr 20, 2023
This issue appears to have been resolved with numba/numba#8852