---
title: "cumulativeProduct(alongAxis:)"
framework: coreml
role: symbol
role_heading: Instance Method
path: "coreml/mltensor/cumulativeproduct(alongaxis:)"
---

# cumulativeProduct(alongAxis:)

Computes the cumulative product along the specified axis.

## Declaration

```swift
func cumulativeProduct(alongAxis axis: Int = 0) -> MLTensor
```

## Parameters

- `axis`: The axis along which to perform the cumulative product. The default value is 0. Must be in the range [-rank, rank) and have a rank greater than zero.

## Return Value

Return Value The result of the cumulative product operation.

## Discussion

Discussion The scalar type of the tensor must be numeric. For example: MLTensor([1, 2, 3]).cumulativeProduct() = [1, 1 * 2, 1 * 2 * 3]

## See Also

### Computing the cumulative value

- [cumulativeSum(alongAxis:)](coreml/mltensor/cumulativesum(alongaxis:).md)
