diff options
Diffstat (limited to 'tensorflow/g3doc/api_docs/python/math_ops.md')
-rw-r--r-- | tensorflow/g3doc/api_docs/python/math_ops.md | 162 |
1 files changed, 87 insertions, 75 deletions
diff --git a/tensorflow/g3doc/api_docs/python/math_ops.md b/tensorflow/g3doc/api_docs/python/math_ops.md index 1f6314d2a6..f0fe5b200f 100644 --- a/tensorflow/g3doc/api_docs/python/math_ops.md +++ b/tensorflow/g3doc/api_docs/python/math_ops.md @@ -88,6 +88,75 @@ Returns x / y element-wise. - - - +### `tf.truediv(x, y, name=None)` {#truediv} + +Divides x / y elementwise, always producing floating point results. + +The same as `tf.div` for floating point arguments, but casts integer arguments +to floating point before dividing so that the result is always floating point. +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.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: + + +* <b>`x`</b>: `Tensor` numerator of numeric type. +* <b>`y`</b>: `Tensor` denominator of numeric type. +* <b>`name`</b>: A name for the operation (optional). + +##### Returns: + + `x / y` evaluated in floating point. + +##### Raises: + + +* <b>`TypeError`</b>: If `x` and `y` have different dtypes. + + +- - - + +### `tf.floordiv(x, y, name=None)` {#floordiv} + +Divides `x / y` elementwise, rounding down for floating point. + +The same as `tf.div(x,y)` for integers, but uses `tf.floor(tf.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`. + +Note that for efficiency, `floordiv` uses C semantics for negative numbers +(unlike Python and Numpy). + +`x` and `y` must have the same type, and the result will have the same type +as well. + +##### Args: + + +* <b>`x`</b>: `Tensor` numerator of real numeric type. +* <b>`y`</b>: `Tensor` denominator of real numeric type. +* <b>`name`</b>: A name for the operation (optional). + +##### Returns: + + `x / y` rounded down (except possibly towards zero for negative integers). + +##### Raises: + + +* <b>`TypeError`</b>: If the inputs are complex. + + +- - - + ### `tf.mod(x, y, name=None)` {#mod} Returns element-wise remainder of division. @@ -693,7 +762,14 @@ for all input submatrices `[..., :, :]`. ### `tf.matrix_inverse(input, name=None)` {#matrix_inverse} -Calculates the inverse of a square invertible matrix. Checks for invertibility. +Calculates the inverse of a square invertible matrix. + +The op uses the Cholesky decomposition if the matrix is symmetric positive +definite and LU decomposition with partial pivoting otherwise. + +If the matrix is not invertible there is no guarantee what the op does. It +may detect the condition and raise an exception or it may simply return a +garbage result. ##### Args: @@ -712,12 +788,19 @@ Calculates the inverse of a square invertible matrix. Checks for invertibility. ### `tf.batch_matrix_inverse(input, name=None)` {#batch_matrix_inverse} -Calculates the inverse of square invertible matrices. Checks for invertibility. +Calculates the inverse of square invertible matrices. The input is a tensor of shape `[..., M, M]` whose inner-most 2 dimensions form square matrices. The output is a tensor of the same shape as the input containing the inverse for all input submatrices `[..., :, :]`. +The op uses the Cholesky decomposition if the matrices are symmetric positive +definite and LU decomposition with partial pivoting otherwise. + +If a matrix is not invertible there is no guarantee what the op does. It +may detect the condition and raise an exception or it may simply return a +garbage result. + ##### Args: @@ -1592,10 +1675,10 @@ Returns the index with the largest value across dimensions of a tensor. ### `tf.listdiff(x, y, name=None)` {#listdiff} -Computes the difference between two lists of numbers. +Computes the difference between two lists of numbers or strings. Given a list `x` and a list `y`, this operation returns a list `out` that -represents all numbers that are in `x` but not in `y`. The returned list `out` +represents all values that are in `x` but not in `y`. The returned list `out` is sorted in the same order that the numbers appear in `x` (duplicates are preserved). This operation also returns a list `idx` that represents the position of each `out` element in `x`. In other words: @@ -1819,74 +1902,3 @@ invert_permutation(x) ==> [2, 4, 3, 0, 1] A `Tensor` of type `int32`. 1-D. - -## Other Functions and Classes -- - - - -### `tf.floordiv(x, y, name=None)` {#floordiv} - -Divides `x / y` elementwise, rounding down for floating point. - -The same as `tf.div(x,y)`, but uses `tf.floor(tf.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`. - -Note that for efficiency, __floordiv__ uses C semantics for negative numbers -(unlike Python and Numpy). - -`x` and `y` must have the same type, and the result will have the same type -as well. - -##### Args: - - -* <b>`x`</b>: `Tensor` numerator of real numeric type. -* <b>`y`</b>: `Tensor` numerator of real numeric type. -* <b>`name`</b>: A name for the operation (optional). - -##### Returns: - - `x / y` rounded down (except possibly for integers in C). - -##### Raises: - - -* <b>`TypeError`</b>: If the inputs are complex. - - -- - - - -### `tf.truediv(x, y, name=None)` {#truediv} - -Divides x / y elementwise, always producing floating point results. - -The same as `tf.div` for floating point arguments, but casts integer arguments -to floating point before dividing so that the result is always floating point. -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.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: - - -* <b>`x`</b>: `Tensor` numerator of numeric type. -* <b>`y`</b>: `Tensor` denominator of numeric type. -* <b>`name`</b>: A name for the operation (optional). - -##### Returns: - - `x / y` evaluated in floating point. - -##### Raises: - - -* <b>`TypeError`</b>: If `x` and `y` have different dtypes. - - |