PyTorch torch.floor 関数


Pytorch torch 参考手册Pytorch torch リファレンス

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))

出力結果は次のとおりです:

tensor([1., 2., 3., -2.])

Pytorch torch 参考手册Pytorch torch リファレンス

その他の拡張