torch.minimum¶ torch.minimum(input, other, *, out=None) → Tensor¶ 計算 input 和 other 的逐元素最小值。 注意 如果被比較的元素中有一個是 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])