快捷方式

torch.minimum

torch.minimum(input, other, *, out=None) Tensor

计算 inputother 的逐元素最小值。

注意

如果被比较的元素之一是 NaN,则返回该元素。 minimum() 不支持复数 dtype 的张量。

参数
  • input (Tensor) – 输入张量。

  • other (Tensor) – 第二个输入张量

关键字参数

out (Tensor, 可选) – 输出张量。

示例

>>> a = torch.tensor((1, 2, -1))
>>> b = torch.tensor((3, 0, 4))
>>> torch.minimum(a, b)
tensor([1, 0, -1])

文档

访问 PyTorch 的全面开发者文档

查看文档

教程

获取面向初学者和高级开发者的深度教程

查看教程

资源

查找开发资源并获得问题解答

查看资源