PyTorch torch.le 関数
torch.leこれは PyTorch において、要素ごとに「以下」を比較するための関数です。
関数定義
torch.le(input, other, out)
使用例
実例
import torch
# 要素ごとの「以下」比較
x = torch.tensor([1, 2, 3, 4])
y = torch.tensor([2, 2, 2, 5])
result = torch.le(x, y)
print(result)
# 要素ごとの「以下」比較
x = torch.tensor([1, 2, 3, 4])
y = torch.tensor([2, 2, 2, 5])
result = torch.le(x, y)
print(result)
その他の拡張
Pytorch torch リファレンスマニュアル