Skip to content
Advertisement

how to use mask using numba @jit

I would like to do simple division and average using jit function where nopython = True.

JavaScript

my jit function goes

JavaScript

however this throws me an error, what would be the workaround for this? I am trying to do this without the loop, any lights would be appreiciate.

Advertisement

Answer

numba doesn’t support some arguments for some of numpy modules (e.g. np.mean() or where in np.divid) (including “axis” argument which is not included). You can do this by some alternative codes like:

JavaScript

JAX library can be used to accelerate as:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement