MCPcopy Create free account
hub / github.com/apache/tvm / cumprod

Function cumprod

python/tvm/topi/gpu/scan.py:729–776  ·  view source on GitHub ↗

Numpy style cumprod op. Return the cumulative product of the elements along a given axis. Parameters ---------- data : tvm.te.Tensor The input data to the operator. axis : int, optional Axis along which the cumulative product is computed. The default (None) is to co

(
    data: tvm.te.Tensor,
    axis: int | None = None,
    dtype: int | None = None,
    exclusive: bool | None = None,
    workspace: tvm.te.Tensor | None = None,
)

Source from the content-addressed store, hash-verified

727
728
729def cumprod(
730 data: tvm.te.Tensor,
731 axis: int | None = None,
732 dtype: int | None = None,
733 exclusive: bool | None = None,
734 workspace: tvm.te.Tensor | None = None,
735):
736 """Numpy style cumprod op. Return the cumulative product of the elements along a given axis.
737
738 Parameters
739 ----------
740 data : tvm.te.Tensor
741 The input data to the operator.
742
743 axis : int, optional
744 Axis along which the cumulative product is computed. The default (None) is to compute
745 the cumproduct over the flattened array.
746
747 dtype : string, optional
748 Type of the returned array and of the accumulator in which the elements are multiplied.
749 If dtype is not specified, it defaults to the dtype of data.
750
751 exclusive : bool, optional
752 If True, will return exclusive product in which the first element is not
753 included. In other terms, if True, the j-th output element would be
754 the product of the first (j-1) elements. Otherwise, it would be the product of
755 the first j elements.
756
757 workspace: Optional[tvm.te.Tensor]
758 A buffer to store intermediate results if thrust is enabled. The size of the workspace
759 should be sufficiently large, this can be obtained by overestimation or memory usage
760 profiling. If None, it will fallback to use thrust internal memory allocation.
761
762 Returns
763 -------
764 result : tvm.te.Tensor
765 The result has the same size as data, and the same shape as data if axis is not None.
766 If axis is None, the result is a 1-d array.
767 """
768 return scanop(
769 data=data,
770 binop=tvm.tirx.generic.multiply,
771 identity_value=1,
772 axis=axis,
773 dtype=dtype,
774 exclusive=exclusive,
775 workspace=workspace,
776 )

Callers

nothing calls this directly

Calls 1

scanopFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…