import torch
# 创建一个一维张量
x = torch.tensor([1, 2, 3,4])
# 计算累积乘积
result = torch.cumprod(x, dim=0)
print(result) # 输出: tensor([1, 2, 6])
01-20
1813
07-12
2003
08-29
350
06-01
12-05
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交