Skip to content

Commit

Permalink
Quantity initialization does not call jax.numpy.asarray when mantis…
Browse files Browse the repository at this point in the history
…sa is a python number
  • Loading branch information
chaoming0625 committed Jan 5, 2025
1 parent 1753e86 commit 16d4887
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,4 @@ cython_debug/
/docs/apis/changelog.md
/dist-hist/
/dist-hist/
/examples/
3 changes: 2 additions & 1 deletion brainunit/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2187,7 +2187,8 @@ def __init__(
# skip 'asarray' if dtype is not provided

elif isinstance(mantissa, (jnp.number, numbers.Number)):
mantissa = jnp.array(mantissa, dtype=dtype)
# mantissa = jnp.array(mantissa, dtype=dtype)
mantissa = mantissa

else:
mantissa = mantissa
Expand Down

0 comments on commit 16d4887

Please sign in to comment.