评价此页

torch.lt#

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

Element-wise computes input<other\text{input} < \text{other}.

第二个参数可以是数字或张量,其形状与第一个参数可广播

参数
  • input (Tensor) – 要比较的张量

  • other (Tensor or float) – the tensor or value to compare

关键字参数

out (Tensor, optional) – 输出张量。

返回

A boolean tensor that is True where input is less than other and False elsewhere

示例

>>> torch.lt(torch.tensor([[1, 2], [3, 4]]), torch.tensor([[1, 1], [4, 4]]))
tensor([[False, False], [True, False]])