• 文档 >
  • torch >
  • torch.cummin
快捷键

torch.cummin

torch.cummin(input, dim, *, out=None)

返回一个命名元组 (values, indices) ,其中 valuesinput 在维度 dim 上的元素累积最小值。 indices 是在维度 dim 上找到的每个最大值的索引位置。

yi=min(x1,x2,x3,,xi)y_i = min(x_1, x_2, x_3, \dots, x_i)
参数:
  • input (Tensor) – 输入张量。

  • dim(int)- 要进行操作的维度

关键字参数:

out(元组,可选)- 两个输出张量的结果元组(值,索引)

示例:

>>> a = torch.randn(10)
>>> a
tensor([-0.2284, -0.6628,  0.0975,  0.2680, -1.3298, -0.4220, -0.3885,  1.1762,
     0.9165,  1.6684])
>>> torch.cummin(a, dim=0)
torch.return_types.cummin(
    values=tensor([-0.2284, -0.6628, -0.6628, -0.6628, -1.3298, -1.3298, -1.3298, -1.3298,
    -1.3298, -1.3298]),
    indices=tensor([0, 1, 1, 1, 4, 4, 4, 4, 4, 4]))

© 版权所有 PyTorch 贡献者。

使用 Sphinx 构建,并使用 Read the Docs 提供的主题。

文档

PyTorch 的全面开发者文档

查看文档

教程

深入了解初学者和高级开发者的教程

查看教程

资源

查找开发资源并获得您的疑问解答

查看资源