cannot determine Numba type of <class 'function'>
See original GitHub issueI am trying to run a function in parallel mode. It is iterating over elements from a list and performing some operations. Since the elements and operations are independent of each other, the operations can be done in parallel, however when i go to compile it(i am using spyder btw) using @njit(parallel= True), I am getting an error saying that ‘cannot determine Numba type of <class ‘function’>’
The loop which is doing the iteration has functions like:
- Addition
- Division and Multiplication
- np.cross(cross product)
- np. array
- Calling functions that are defined earlier(outside @njit)
The error dump is pasted below:
runfile('C:/Users/Arghyadeep/Desktop/p1.py', wdir='C:/Users/Arghyadeep/Desktop')
Traceback (most recent call last):
File "<ipython-input-38-1f08c1876264>", line 1, in <module>
runfile('C:/Users/Arghyadeep/Desktop/p1.py', wdir='C:/Users/Arghyadeep/Desktop')
File "C:\Users\Arghyadeep\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)
File "C:\Users\Arghyadeep\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/Arghyadeep/Desktop/p1.py", line 73, in <module>
parallelBoris(10)
File "C:\Users\Arghyadeep\Anaconda3\lib\site-packages\numba\dispatcher.py", line 376, in _compile_for_args
error_rewrite(e, 'typing')
File "C:\Users\Arghyadeep\Anaconda3\lib\site-packages\numba\dispatcher.py", line 343, in error_rewrite
reraise(type(e), e, None)
File "C:\Users\Arghyadeep\Anaconda3\lib\site-packages\numba\six.py", line 658, in reraise
raise value.with_traceback(tb)
TypingError: cannot determine Numba type of <class 'function'>
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
TypingError: cannot determine Numba type of <class ...
I have a simple function to rank poker hands ...
Read more >Cannot determine Numba type of <class 'type'> - Support
Cannot determine Numba type of <class 'type'>. This is my code and the input xq is a (N,3) ndarray. @njit(parallel=True) def fraction_field(xq): N...
Read more >First Steps with numba — numba 0.12.0 documentation
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...
Read more >TypingError: cannot determine Numba type of class ... - YouTube
Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn--Music by Eric Matyashttps://www.soundimage.
Read more >Types and signatures - Numba documentation
As an optimizing compiler, Numba needs to decide on the type of each variable to ... First-class function support is enabled for all...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Did you do something like:
the root cause of which is that the functions called by
@jit
decorated functions also need to be@jit
decorated. i.e.Closing this issue as it seems to be resolved. If this is not the case please re-open with a comment about any item that appears to be unresolved. Many thanks.