Skip to content

Commit

Permalink
Update _event_matvec.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Routhleck committed Feb 29, 2024
1 parent 7c950bd commit 4306e07
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions brainpy/_src/math/jitconn/_event_matvec.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,13 +792,12 @@ def event_mv_prob_homo_taichi(
"""
events = as_jax(events)
if isinstance(weight, float): weight = as_jax(weight)
print(weight.shape)
print(weight)
if weight is None or (isinstance(weight, (np.ndarray, jnp.ndarray)) and not weight.size):
raise ValueError(f'Unexpected weight value or shape: {weight}')
try:
weight = jnp.atleast_1d(as_jax(weight))
except:
print(f'weight_value:{weight}')
print(f'weight_shape:{weight.shape}')
raise ValueError(f'weight_value:{weight}')
conn_len = jnp.ceil(1 / conn_prob) * 2 - 1
conn_len = jnp.asarray(jnp.atleast_1d(conn_len), dtype=jnp.int32)
if seed is None:
Expand Down

0 comments on commit 4306e07

Please sign in to comment.