---
title: "cumulativeSum(_:axisTensor:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/cumulativesum(_:axistensor:name:)"
---

# cumulativeSum(_:axisTensor:name:)

Computes the cumulative sum of the input tensor along the specified axis.

## Declaration

```swift
func cumulativeSum(_ tensor: MPSGraphTensor, axisTensor: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

- `tensor`: The input tensor
- `axisTensor`: The tensor dimension where you compute the cumulative operation
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object
