If I define
import numba as nb
import numpy as np
@nb.vectorize
def nb_vec(x):
if x>0:
x=x+100
return x
then
x=np.random.random(1000000)
nb_vec(x)
run without problem
But If I add target option like
@nb.vectorize(target='parallel')
def nb_vec(x):
if x>0:
x=x+100
return x
then
x=np.random.random(1000000)
nb_vec(x)
outputs error message
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) in 1 x=np.random.random(1000000) ----> 2 nb_vec(x)
TypeError: ufunc 'nb_vec' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
What is wrong?