Skip to main content
Log in

Mojo function

cumsum

cumsum(dst: NDBuffer[type, 1, origin], src: NDBuffer[type, 1, origin, 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, origin]): The buffer that stores the result of cumulative sum operation.
  • src (NDBuffer[type, 1, origin, shape, strides]): The buffer of elements for which the cumulative sum is computed.