Skip to content

Commit

Permalink
Removing numba deprecation warnings (#262)
Browse files Browse the repository at this point in the history
* initial commit

* flake8 fixes

Co-authored-by: acs-ws <[email protected]>
  • Loading branch information
AhmetCanSolak and acs-ws authored Oct 18, 2022
1 parent a55e9ee commit fa882a8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions aydin/it/normalisers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,16 @@ def denormalise(

return array

@jit(parallel=True, error_model='numpy')
def normalize_numba(self, array, min_value, max_value, epsilon):
for _ in prange(numpy.prod(array.shape)):
@staticmethod
@jit(nopython=True, parallel=True, error_model='numpy')
def normalize_numba(array, min_value, max_value, epsilon):
for _ in prange(numpy.prod(numpy.array(array.shape))):
array.flat[_] -= min_value
array.flat[_] /= max_value - min_value + epsilon

@jit(parallel=True, error_model='numpy')
def denormalize_numba(self, array, min_value, max_value, epsilon):
for _ in prange(numpy.prod(array.shape)):
@staticmethod
@jit(nopython=True, parallel=True, error_model='numpy')
def denormalize_numba(array, min_value, max_value, epsilon):
for _ in prange(numpy.prod(numpy.array(array.shape))):
array.flat[_] *= max_value - min_value + epsilon
array.flat[_] += min_value

0 comments on commit fa882a8

Please sign in to comment.