TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tf.div

View source on GitHub

Divides x / y elementwise (using Python 2 division operator semantics). (deprecated)

Aliases:

  • tf.RaggedTensor.__div__
  • tf.compat.v1.RaggedTensor.__div__
  • tf.compat.v1.div
  • tf.compat.v2.RaggedTensor.__div__
tf.div(
    x,
    y,
    name=None
)

NOTE: Prefer using the Tensor division operator or tf.divide which obey Python 3 division operator semantics.

This function divides x and y, forcing Python 2 semantics. That is, if x and y are both integers then the result will be an integer. This is in contrast to Python 3, where division with / is always a float while division with // is always an integer.

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 returns the quotient of x and y.