tf.compat.v1.div  |  TensorFlow v2.16.1 (original) (raw)

tf.compat.v1.div

Stay organized with collections Save and categorize content based on your preferences.

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

tf.compat.v1.div(
    x, y, name=None
)

Migrate to TF2

This function is deprecated in TF2. Prefer using the Tensor division operator,tf.divide, or tf.math.divide, which obey the Python 3 division operator semantics.

Description

This function divides x and y, forcing Python 2 semantics. That is, if xand 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.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.

Last updated 2024-04-26 UTC.