| View source on GitHub | 
Divides x / y elementwise (using Python 3 division operator semantics).
tf.math.truediv(
    x, y, name=None
)
  Note: Prefer using the Tensor operator or tf.divide which obey Python division operator semantics.
This function forces Python 3 division operator semantics where all integer arguments are cast to floating types first. This op is generated by normal x / y division in Python 3 and in Python 2.7 with from __future__ import division. If you want integer division that rounds down, use x // y or tf.math.floordiv.
x and y must have the same numeric type. If the inputs are floating point, the output will have the same type. If the inputs are integral, the inputs are cast to float32 for int8 and int16 and float64 for int32 and int64 (matching the behavior of Numpy).
| Args | |
|---|---|
| x | Tensornumerator of numeric type. | 
| y | Tensordenominator of numeric type. | 
| name | A name for the operation (optional). | 
| Returns | |
|---|---|
| x / yevaluated in floating point. | 
| Raises | |
|---|---|
| TypeError | If xandyhave different dtypes. | 
    © 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
    https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/math/truediv