Contents

cumulativeProduct(alongAxis:)

Computes the cumulative product along the specified axis.

Declaration

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

The result of the cumulative product operation.

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