PyTorch torch.ceil function
PyTorch torch reference manual
torch.ceil is a function in PyTorch used to round each element up to the nearest integer.
Function definition
torch.ceil(input, out=None)
Usage examples
Example
import
torch
x
=
torch.
tensor
(
[
1.1
,
2.5
,
3.7
,
1.2
]
)
(
torch.
ceil
(
x
)
)
The output is:
tensor([2., 3., 4., -1.])