round

dragon.vm.tensorflow.math.round(
  x,
  name=None
)[source]

Compute the nearest integer of input.

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

Examples:

x = tf.constant([0.9, 1.4, 1.9])
print(tf.math.round(x))  # [1., 1., 2.]
Parameters:
  • x (dragon.Tensor) – The input tensor.
  • name (str, optional) – A optional name for the operation.
Returns:

dragon.Tensor – The output tensor.