快捷方式

torch.minimum

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

計算 inputother 的逐元素最小值。

注意

如果被比較的元素中有一個是 NaN,則返回該元素。minimum() 不支援具有複數 dtypes 的張量。

引數
  • 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 的全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得解答

檢視資源