Skip to main content
Log in

Mojo function

cumsum

cumsum(dst: NDBuffer[type, 1], src: NDBuffer[type, 1, shape, strides])

Computes the cumulative sum of all elements in a buffer. dst[i] = src[i] + src[i-1] + ... + src[0].

Args:

  • dst (NDBuffer[type, 1]): The buffer that stores the result of cumulative sum operation.
  • src (NDBuffer[type, 1, shape, strides]): The buffer of elements for which the cumulative sum is computed.