tf.math.floordiv

Divides x / y elementwise, rounding toward the most negative integer.

Aliases:

  • tf.RaggedTensor.__floordiv__
  • tf.compat.v1.RaggedTensor.__floordiv__
  • tf.compat.v1.floordiv
  • tf.compat.v1.math.floordiv
  • tf.compat.v2.RaggedTensor.__floordiv__
  • tf.compat.v2.math.floordiv
  • tf.floordiv
  • tf.math.floordiv
tf.math.floordiv(
    x,
    y,
    name=None
)

Defined in python/ops/math_ops.py.

The same as tf.compat.v1.div(x,y) for integers, but uses tf.floor(tf.compat.v1.div(x,y)) for floating point arguments so that the result is always an integer (though possibly an integer represented as floating point). This op is generated by x // y floor division in Python 3 and in Python 2.7 with from __future__ import division.

x and y must have the same type, and the result will have the same type as well.

Args:

  • x: Tensor numerator of real numeric type.
  • y: Tensor denominator of real numeric type.
  • name: A name for the operation (optional).

Returns:

x / y rounded down.

Raises:

  • TypeError: If the inputs are complex.