-
Notifications
You must be signed in to change notification settings - Fork 102
Open
Labels
brainpy.mathissue belongs to brainpy.math moduleissue belongs to brainpy.math modulebugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
- Check for duplicate issues.
- Provide a complete example of how to reproduce the bug, wrapped in triple backticks like this:
- If applicable, include full error messages/tracebacks.
I am trying to implement the function in Brainpy: x / (1.0 - bm.exp(-x))
. When x->0
, the function has a theoretical limit of 1.0
, but if we directly set x=0
, the function will output NaN
.
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?
Metadata
Metadata
Assignees
Labels
brainpy.mathissue belongs to brainpy.math moduleissue belongs to brainpy.math modulebugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request