torch.minimum¶ torch.minimum(input, other, *, out=None) → 张量¶ 计算 input 和 other 的逐元素最小值。 注意 如果被比较的元素之一是 NaN,则返回该元素。 minimum() 不支持复杂数据类型的张量。 Parameters 输入 (张量) – 输入张量。 其他 (Tensor) – 第二个输入张量 Keyword Arguments 输出 (张量, 可选) – 输出张量。 示例: >>> a = torch.tensor((1, 2, -1)) >>> b = torch.tensor((3, 0, 4)) >>> torch.minimum(a, b) tensor([1, 0, -1])