title: __init__() got an unexpected keyword argument 'py_func'
body: <p>We will use the numba.jit decorator for the function we want to compute over the GPU. The decorator has several parameters but we will work with only the target parameter. Target tells the jit to compile codes for which source(“CPU” or “Cuda”). “Cuda” corresponds to GPU. However, if CPU is passed as an argument then the jit tries to optimize the code run faster on CPU and improves the speed too.
  But i got the error -- <strong>init</strong>() got an unexpected keyword argument 'py_func'</p>
  <pre><code>from numba import jit, cuda 
  import numpy as np 
  # to measure exec time 
  from timeit import default_timer as timer    
  
  # normal function to run on cpu 
  def func(a):                                 
      for i in range(10000000): 
          a[i]+= 1      
  
  # function optimized to run on gpu  
  @jit(target =&quot;cuda&quot;)                          
  def func2(a): 
      for i in range(10000000): 
          a[i]+= 1
  if __name__==&quot;__main__&quot;: 
      n = 10000000                            
      a = np.ones(n, dtype = np.float64) 
      b = np.ones(n, dtype = np.float32) 
    
      start = timer() 
      func(a) 
      print(&quot;without GPU:&quot;, timer()-start)     
    
      start = timer() 
      func2(a) 
      print(&quot;with GPU:&quot;, timer()-start) 
  </code></pre>