参考链接: torch.lt(input, other, out=None) → Tensor
参考链接: lt(other) → Tensor
函数使用说明:
两个可广播的张量之间进行逐元素比较操作,
判断是否满足小于的条件.
代码实验举例:
Microsoft Windows [版本 10.0.18363.1256]
(c) 2019 Microsoft Corporation。保留所有权利。
C:\Users\chenxuqi>conda activate ssd4pytorch1_2_0
(ssd4pytorch1_2_0) C:\Users\chenxuqi>python
Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> input = torch.tensor([[1, 2], [3, 4]])
>>> other = torch.tensor([[1, 1], [4, 4]])
>>> input
tensor([[1, 2],
[3, 4]])
>>> other
tensor([[1, 1],
[4, 4]])
>>> torch.lt(input, other)
tensor([[False, False],
[ True, False]])
>>>
>>>
>>>