Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tensor] Add cumsum operation #1720

Open
laggui opened this issue May 3, 2024 · 1 comment
Open

[Tensor] Add cumsum operation #1720

laggui opened this issue May 3, 2024 · 1 comment
Labels
enhancement Enhance existing features

Comments

@laggui
Copy link
Member

laggui commented May 3, 2024

Implement cumulative sum across an input dimension.

Example:

let x = Tensor::arange(0..6 as i64, &device);
x.cumsum(0)
// [ 0,  1,  3,  6, 10, 15]
@laggui laggui added the enhancement Enhance existing features label May 3, 2024
@louisfd
Copy link
Member

louisfd commented May 3, 2024

cumprod has also been asked for twice on discord:
https://discord.com/channels/1038839012602941528/1038839013735399547/1234609825619644477
https://discord.com/channels/1038839012602941528/1091796857996451942/1202670351322972302

let x = Tensor::arange(1..7 as i64, &device);
x.cumsum(0)
// [ 1,  2,  6,  24, 120, 720]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhance existing features
Projects
None yet
Development

No branches or pull requests

2 participants