PyTorch torch.floor 関数
torch.floorこれは PyTorch で要素ごとに floor(切り捨て)を行う関数です。
関数定義
torch.floor(input, out=None)
使用例
例
import torch
x = torch.tensor([1.1, 2.5, 3.7, -1.2])
print(torch.floor(x))
x = torch.tensor([1.1, 2.5, 3.7, -1.2])
print(torch.floor(x))
出力結果は次のとおりです:
tensor([1., 2., 3., -2.])
その他の拡張
Pytorch torch リファレンス