torch.prod(input)返回input全部元素的乘积 import torch b = torch.tensor([2, 3.3]) print(torch.prod(b)) 输出 tensor(6.6000)