Brainpy array does not support "where" argument in division #453
Labels
brainpy.math
issue belongs to brainpy.math module
bug
Something isn't working
enhancement
New feature or request
I am trying to implement the function in Brainpy:
x / (1.0 - bm.exp(-x))
. Whenx->0
, the function has a theoretical limit of1.0
, but if we directly setx=0
, the function will outputNaN
.In Numpy, this can be handled by:
np.divide(x, 1.0-np.exp(-x), out=np.ones_like(x), where=np.abs(x)>=1.0e-6)
.However, in Brainpy, the similar expression does not work:
bm.divide(x, 1.0-bm.exp(-x), out=bm.ones_like(x), where=bm.abs(x)>=1.0e-6)
. The error message is:TypeError: true_divide() got an unexpected keyword argument 'where'
.How can we deal with situations like this in Brainpy?
The text was updated successfully, but these errors were encountered: