brainpy.math.event_csr_matvec#

brainpy.math.event_csr_matvec(values, indices, indptr, events, shape, transpose=False)[source]#

The pre-to-post event-driven synaptic summation with CSR synapse structure.

Parameters
  • values (ArrayType, float) – An array of shape (nse,) or a float.

  • indices (ArrayType) – An array of shape (nse,).

  • indptr (ArrayType) – An array of shape (shape[0] + 1,) and dtype indices.dtype.

  • events (ArrayType) – An array of shape (shape[0] if transpose else shape[1],) and dtype data.dtype.

  • shape (tuple of int) – A length-2 tuple representing the sparse matrix shape.

  • transpose (bool) – A boolean specifying whether to transpose the sparse matrix before computing. Default is False.

Returns

out – A tensor with the shape of shape[1] if transpose=True, or shape[0] if transpose=False.

Return type

ArrayType