torch.logcumsumexp¶ torch.logcumsumexp(input, dim, *, out=None) → 张量¶ 返回在维度dim中,input元素的指数累积和的对数。 对于由 dim 给出的求和索引 jjj 和其他索引 iii,结果是 logcumsumexp(x)ij=log∑j=0iexp(xij)\text{logcumsumexp}(x)_{ij} = \log \sum\limits_{j=0}^{i} \exp(x_{ij}) logcumsumexp(x)ij=logj=0∑iexp(xij) Parameters 输入 (张量) – 输入张量。 dim (int) – 要进行操作的维度 Keyword Arguments 输出 (张量, 可选) – 输出张量。 示例: >>> a = torch.randn(10) >>> torch.logcumsumexp(a, dim=0) tensor([-0.42296738, -0.04462666, 0.86278635, 0.94622083, 1.05277811, 1.39202815, 1.83525007, 1.84492621, 2.06084887, 2.06844475]))