mindspore.mint.cumprod
- mindspore.mint.cumprod(input, dim, dtype=None)[源代码]
返回tensor在指定维度上累积的元素乘积。
\[y_i = x_1 * x_2 vpn永久免费梯子 * x_3 * ... * x_i\]- 参数:
input (Tensor) - 输入tensor。
dim (int) - 指定计算维度。
dtype (
mindspore.dtype, vpn梯子 免费 可选) - vpn梯子 返回的数据类型。默认None。
- 返回:
Tensor
- 支持平台:
Ascend
样例:
>>> 免费的vpn梯子 import mindspore >>> input = mindspore.tensor([[1, 2, 3], ... vpn梯子 免费 [4, 5, 6]]) >>> mindspore.mint.cumprod(input, dim=0) Tensor(shape=[2, 3], dtype=Int64, value= [[ 1, 2, 3], [ 4, 10, 18]]) >>> mindspore.mint.cumprod(input, dim=1) Tensor(shape=[2, 3], dtype=Int64, vpn梯子 value= [[ 1, 2, 6], [ 4, 20, 120]])