You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/10/30 03:55:39 UTC

[GitHub] szha commented on issue #13001: Feature request: numpy.cumsum

szha commented on issue #13001: Feature request: numpy.cumsum
URL: https://github.com/apache/incubator-mxnet/issues/13001#issuecomment-434163210
 
 
   `cumsum` is needed when you have an array of lengths with which to slice another concatenated array, and you want to calculate the start and end index to use. For example, suppose you have three arrays of different lengths, and you concatenated them like:
   `[1, 2, 3], [4, 5], [6, 7, 8, 9] => [1, 2, 3, 4, 5, 6, 7, 8, 9]`
   Their corresponding lengths are `[3, 2, 4]`.
   The `cumsum` would be `[3, 5, 9]`, with which you can slice `[0, 3)` for first array, `[3, 5)` for second array, and `[5, 9)` for third array.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services