brainpy.math.pre2post_event_prod
brainpy.math.pre2post_event_prod#
- brainpy.math.pre2post_event_prod(events, pre2post, post_num, values=1.0)[source]#
The pre-to-post synaptic computation with event-driven production.
When
values
is a scalar, this function is equivalent topost_val = np.ones(post_num) post_ids, idnptr = pre2post for i in range(pre_num): if events[i]: for j in range(idnptr[i], idnptr[i+1]): post_val[post_ids[i]] *= values
When
values
is a vector (with the length oflen(post_ids)
), this function is equivalent topost_val = np.ones(post_num) post_ids, idnptr = pre2post for i in range(pre_num): if events[i]: for j in range(idnptr[i], idnptr[i+1]): post_val[post_ids[i]] *= values[j]
- Parameters
- Returns
out – A tensor with the shape of
post_num
.- Return type
ArrayType