round

dragon.vm.torch.round(
  input,
  out=None
)[source]

Compute the nearest integer of input.

\[\text{out} = \lfloor \text{input} \rceil \]

Examples:

x = torch.tensor([0.9, 1.4, 1.9])
print(torch.round(x))  # [1., 1., 2.]
Parameters:
Returns:

dragon.vm.torch.Tensor – The output tensor.