---
title: "cumsum"
sidebar_label: "cumsum"
description: "Kotlin binding reference: cumsum."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[cumsum](cumsum.md)

# cumsum

[common]\
fun [cumsum](cumsum.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), dtype: [DType](../DType/index.md) = DType.UNDEFINED): [Tensor](../Tensor/index.md)

`cumsum(input: Tensor, dim: Long, dtype: DType = DType.UNDEFINED)`: the `cumsum` operator. Cumulative sum along `dim` (inclusive scan). Output mirrors `input`'s shape; `dtype` widens the accumulation/output when set (`Undefined` keeps `input`'s dtype).