PyTorch torch.le 関数


Pytorch torch 参考手册Pytorch torch リファレンスマニュアル

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)

Pytorch torch 参考手册Pytorch torch リファレンスマニュアル

その他の拡張