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