Skip to main content

ClikaRT::ops::cumprod

function

cumprod()

Tensor cumprod(
    Tensor x,
    int64_t dim,
    DataType dtype = DataType::Undefined
)

Cumulative product along dim (inclusive scan).

outk=jkxj\mathrm{out}_k = \prod_{j \le k} x_j

Parameters

  • x: the input tensor.
  • dim: the axis to scan along.
  • dtype: output dtype; Undefined keeps x's dtype.

Returns: the scanned tensor, same shape as x.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) when dim is out of range.

Declared in ClikaRT/compute/ops.h, line 4526