numba

Numba "LoweringError" for complex numbers in numpy array

Numba "LoweringError" for complex numbers in numpy array Question: I have to make a calculation using complex arrays, however when using numba to speed up the process I get an error numba.core.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend). Here it is a simplified version of my code: import numpy as np from …

Total answers: 2

Further optimizing the ISING model

Further optimizing the ISING model Question: I’ve implemented the 2D ISING model in Python, using NumPy and Numba’s JIT: from timeit import default_timer as timer import matplotlib.pyplot as plt import numba as nb import numpy as np # TODO for Dict optimization. # from numba import types # from numba.typed import Dict @nb.njit(nogil=True) def initialstate(N): …

Total answers: 2

Can we really do parallel computing using numba python library in python?

Can we really do parallel computing using numba python library in python? Question: I am new to CUDA and was going through Running Python script on GPU. Performance with GPU is better than that without GPU (without GPU: 3.525673059999974, with GPU: 0.07701390800002628) for the following code executed in a colab notebook: from numba import jit, …

Total answers: 1

Julia running an order of magnitude slower than python

Julia running an order of magnitude slower than python Question: I was trying to port a python code into Julia to try it out (both codes are given below). Julia is running about 10 times slower on my machine than python. What am I doing wrong? I am pretty new to Julia, so appreciate any …

Total answers: 1

Numba – TypingError with numpy symbol arrays (njit)

Numba – TypingError with numpy symbol arrays (njit) Question: I tried to execute this code, but when I call it for the first time to compile numba is angry on a line gen_code = np.array([]) : char_array = np.array([‘a’,’b’,’c’,’d’,’e’,’f’,’g’,’h’,’i’,’j’,’k’,’l’,’m’,’n’,’o’,’p’,’q’,’r’, ‘s’,’t’,’u’,’v’,’w’,’x’,’y’,’z’,’A’,’B’,’C’,’D’,’E’,’F’,’G’,’H’,’I’,’J’, ‘K’,’L’,’M’,’N’,’O’,’P’,’Q’,’R’,’S’,’T’,’U’,’V’,’W’,’X’,’Y’,’Z’,’0′,’1′, ‘2’,’3′,’4′,’5′,’6′,’7′,’8′,’9′]) # creating a random 40-lenghted code from characters in char_array and returning as …

Total answers: 1

Much different result when using numba

Much different result when using numba Question: I have here pure python code, except just making a NumPy array. My problem here is that the result I get is completely wrong when I use @jit, but when I remove it its good. Could anyone give me any tips on why this is? @jit def grayFun(image: …

Total answers: 2