Skip to content
Snippets Groups Projects
Commit aedd0cf4 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

[_library.py] implement array_jit decorator correctly

Fixes #64
parent a7c665ec
Branches
Tags
1 merge request!104[_library.py] implement array_jit decorator correctly
Pipeline #52314 passed
...@@ -10,6 +10,7 @@ import numpy ...@@ -10,6 +10,7 @@ import numpy
import numpy.linalg import numpy.linalg
from numba import jit, objmode from numba import jit, objmode
import logging import logging
from functools import wraps
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -26,6 +27,7 @@ def _lists_to_arrays(*args, **kwargs): ...@@ -26,6 +27,7 @@ def _lists_to_arrays(*args, **kwargs):
def array_jit(func): def array_jit(func):
jit_func = jit(func, nopython=True) jit_func = jit(func, nopython=True)
@wraps(jit_func)
def new_func(*args, **kwargs): def new_func(*args, **kwargs):
args, kwargs = _lists_to_arrays(*args, **kwargs) args, kwargs = _lists_to_arrays(*args, **kwargs)
return jit_func(*args, **kwargs) return jit_func(*args, **kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment