# Module: tf.math

Math Operations.

Note: Functions taking Tensor arguments can also take anything accepted by tf.convert_to_tensor.

See: tf.linalg免费成长做爱直播有哪些 for matrix and tensor functions.

TensorFlow provides several operations that you can use to perform common math computations on tensor segments. Here a segmentation is a partitioning of a tensor along the first dimension, i.e. it defines a mapping from the first dimension onto segment_ids. The segment_ids tensor should be the size of the first dimension, d0, with consecutive IDs in the range 0 to k, where k<d0免费成长做爱直播有哪些. In particular, a segmentation of a matrix tensor is a mapping of rows to segments.

#### For example:

c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
tf.math.segment_sum(c, tf.constant([0, 0, 1]))
#  ==>  [[0 0 0 0]
#        [5 6 7 8]]


The standard segment_* functions assert that the segment indices are sorted. If you have unsorted indices use the equivalent unsorted_segment_ function. Thses functions take an additional argument num_segments so that the output tensor can be efficiently allocated.

c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
tf.math.unsorted_segment_sum(c, tf.constant([0, 1, 0]), num_segments=2)
# ==> [[ 6,  8, 10, 12],
#       [-1, -2, -3, -4]]


## Functions

abs(...): Computes the absolute value of a tensor.

accumulate_n(...): Returns the element-wise sum of a list of tensors.

acos(...): Computes acos of x element-wise.

acosh(...): Computes inverse hyperbolic cosine of x element-wise.

add(...)免费成长做爱直播有哪些: Returns x + y element-wise.

add_n(...)免费成长做爱直播有哪些: Adds all input tensors element-wise.

angle(...)免费成长做爱直播有哪些: Returns the element-wise argument of a complex (or real) tensor.

argmax(...)免费成长做爱直播有哪些: Returns the index with the largest value across axes of a tensor.

argmin(...)免费成长做爱直播有哪些: Returns the index with the smallest value across axes of a tensor.

asin(...)免费成长做爱直播有哪些: Computes the trignometric inverse sine of x element-wise.

asinh(...)免费成长做爱直播有哪些: Computes inverse hyperbolic sine of x element-wise.

atan(...)免费成长做爱直播有哪些: Computes the trignometric inverse tangent of x element-wise.

atan2(...): Computes arctangent of y/x element-wise, respecting signs of the arguments.

atanh(...)免费成长做爱直播有哪些: Computes inverse hyperbolic tangent of x element-wise.

bessel_i0(...): Computes the Bessel i0 function of x element-wise.

bessel_i0e(...): Computes the Bessel i0e function of x element-wise.

bessel_i1(...): Computes the Bessel i1 function of x免费成长做爱直播有哪些 element-wise.

bessel_i1e(...): Computes the Bessel i1e function of x element-wise.

betainc(...): Compute the regularized incomplete beta integral $$I_x(a, b)$$.

bincount(...): Counts the number of occurrences of each value in an integer array.

ceil(...): Returns element-wise smallest integer not less than x.

confusion_matrix(...)免费成长做爱直播有哪些: Computes the confusion matrix from predictions and labels.

conj(...): Returns the complex conjugate of a complex number.

cos(...): Computes cos of x element-wise.

cosh(...): Computes hyperbolic cosine of x element-wise.

count_nonzero(...): Computes number of nonzero elements across dimensions of a tensor.

cumprod(...): Compute the cumulative product of the tensor x along axis.

cumsum(...): Compute the cumulative sum of the tensor x along axis.

cumulative_logsumexp(...): Compute the cumulative log-sum-exp of the tensor x along axis.

digamma(...): Computes Psi, the derivative of Lgamma (the log of the absolute value of

divide(...): Computes Python style division of x by y.

divide_no_nan(...): Computes an unsafe divide which returns 0 if the y is zero.

equal(...): Returns the truth value of (x == y) element-wise.

erf(...): Computes the Gauss error function of x免费成长做爱直播有哪些 element-wise.

erfc(...): Computes the complementary error function of x免费成长做爱直播有哪些 element-wise.

exp(...)免费成长做爱直播有哪些: Computes exponential of x element-wise. $$y = e^x$$.

expm1(...): Computes exp(x) - 1免费成长做爱直播有哪些 element-wise.

floor(...): Returns element-wise largest integer not greater than x.

floordiv(...): Divides x / y免费成长做爱直播有哪些 elementwise, rounding toward the most negative integer.

floormod(...): Returns element-wise remainder of division. When x < 0 xor y < 0 is

greater(...): Returns the truth value of (x > y) element-wise.

greater_equal(...)免费成长做爱直播有哪些: Returns the truth value of (x >= y) element-wise.

igamma(...): Compute the lower regularized incomplete Gamma function P(a, x).

igammac(...): Compute the upper regularized incomplete Gamma function Q(a, x).

imag(...): Returns the imaginary part of a complex (or real) tensor.

in_top_k(...): Says whether the targets are in the top K predictions.

invert_permutation(...)免费成长做爱直播有哪些: Computes the inverse permutation of a tensor.

is_finite(...): Returns which elements of x are finite.

is_inf(...): Returns which elements of x are Inf.

is_nan(...): Returns which elements of x are NaN.

is_non_decreasing(...): Returns True if x is non-decreasing.

is_strictly_increasing(...): Returns True if x免费成长做爱直播有哪些 is strictly increasing.

l2_normalize(...): Normalizes along dimension axis免费成长做爱直播有哪些 using an L2 norm.

lbeta(...)免费成长做爱直播有哪些: Computes $$ln(|Beta(x)|)$$, reducing along the last dimension.

less(...)免费成长做爱直播有哪些: Returns the truth value of (x < y) element-wise.

less_equal(...)免费成长做爱直播有哪些: Returns the truth value of (x <= y) element-wise.

lgamma(...): Computes the log of the absolute value of Gamma(x) element-wise.

log(...): Computes natural logarithm of x element-wise.

log1p(...): Computes natural logarithm of (1 + x) element-wise.

log_sigmoid(...): Computes log sigmoid of x element-wise.

log_softmax(...): Computes log softmax activations.

logical_and(...): Returns the truth value of x AND y element-wise.

logical_not(...): Returns the truth value of NOT x element-wise.

logical_or(...)免费成长做爱直播有哪些: Returns the truth value of x OR y element-wise.

logical_xor(...)免费成长做爱直播有哪些: Logical XOR function.

maximum(...)免费成长做爱直播有哪些: Returns the max of x and y (i.e. x > y ? x : y) element-wise.

minimum(...)免费成长做爱直播有哪些: Returns the min of x and y (i.e. x < y ? x : y) element-wise.

mod(...): Returns element-wise remainder of division. When x < 0 xor y < 0 is

multiply(...): Returns x * y element-wise.

multiply_no_nan(...)免费成长做爱直播有哪些: Computes the product of x and y and returns 0 if the y is zero, even if x is NaN or infinite.

negative(...): Computes numerical negative value element-wise.

nextafter(...): Returns the next representable value of x1 in the direction of x2免费成长做爱直播有哪些, element-wise.

not_equal(...)免费成长做爱直播有哪些: Returns the truth value of (x != y) element-wise.

polygamma(...): Compute the polygamma function $$\psi^{(n)}(x)$$.

polyval(...)免费成长做爱直播有哪些: Computes the elementwise value of a polynomial.

pow(...): Computes the power of one value to another.

real(...)免费成长做爱直播有哪些: Returns the real part of a complex (or real) tensor.

reciprocal(...)免费成长做爱直播有哪些: Computes the reciprocal of x element-wise.

reciprocal_no_nan(...): Performs a safe reciprocal operation, element wise.

reduce_all(...)免费成长做爱直播有哪些: Computes the "logical and" of elements across dimensions of a tensor.

reduce_any(...)免费成长做爱直播有哪些: Computes the "logical or" of elements across dimensions of a tensor.

reduce_euclidean_norm(...): Computes the Euclidean norm of elements across dimensions of a tensor.

reduce_logsumexp(...): Computes log(sum(exp(elements across dimensions of a tensor))).

reduce_max(...)免费成长做爱直播有哪些: Computes the maximum of elements across dimensions of a tensor.

reduce_mean(...): Computes the mean of elements across dimensions of a tensor.

reduce_min(...): Computes the minimum of elements across dimensions of a tensor.

reduce_prod(...): Computes the product of elements across dimensions of a tensor.

reduce_std(...): Computes the standard deviation of elements across dimensions of a tensor.

reduce_sum(...): Computes the sum of elements across dimensions of a tensor.

reduce_variance(...): Computes the variance of elements across dimensions of a tensor.

rint(...): Returns element-wise integer closest to x.

round(...): Rounds the values of a tensor to the nearest integer, element-wise.

rsqrt(...)免费成长做爱直播有哪些: Computes reciprocal of square root of x element-wise.

scalar_mul(...): Multiplies a scalar times a Tensor or IndexedSlices object.

segment_max(...): Computes the maximum along segments of a tensor.

segment_mean(...)免费成长做爱直播有哪些: Computes the mean along segments of a tensor.

segment_min(...)免费成长做爱直播有哪些: Computes the minimum along segments of a tensor.

segment_prod(...): Computes the product along segments of a tensor.

segment_sum(...)免费成长做爱直播有哪些: Computes the sum along segments of a tensor.

sigmoid(...): Computes sigmoid of x element-wise.

sign(...): Returns an element-wise indication of the sign of a number.

sin(...): Computes sine of x element-wise.

sinh(...)免费成长做爱直播有哪些: Computes hyperbolic sine of x element-wise.

softmax(...): Computes softmax activations.

softplus(...): Computes softplus: log(exp(features) + 1).

softsign(...): Computes softsign: features / (abs(features) + 1).

sqrt(...): Computes square root of x element-wise.

square(...): Computes square of x element-wise.

squared_difference(...)免费成长做爱直播有哪些: Returns (x - y)(x - y) element-wise.

subtract(...): Returns x - y element-wise.

tan(...)免费成长做爱直播有哪些: Computes tan of x element-wise.

tanh(...): Computes hyperbolic tangent of x element-wise.

top_k(...): Finds values and indices of the k largest entries for the last dimension.

truediv(...): Divides x / y elementwise (using Python 3 division operator semantics).

unsorted_segment_max(...): Computes the maximum along segments of a tensor.

unsorted_segment_mean(...)免费成长做爱直播有哪些: Computes the mean along segments of a tensor.

unsorted_segment_min(...): Computes the minimum along segments of a tensor.

unsorted_segment_prod(...)免费成长做爱直播有哪些: Computes the product along segments of a tensor.

unsorted_segment_sqrt_n(...)免费成长做爱直播有哪些: Computes the sum along segments of a tensor divided by the sqrt(N).

unsorted_segment_sum(...): Computes the sum along segments of a tensor.

xdivy(...): Returns 0 if x == 0, and x / y otherwise, elementwise.

xlogy(...)免费成长做爱直播有哪些: Returns 0 if x == 0, and x * log(y) otherwise, elementwise.

zero_fraction(...): Returns the fraction of zeros in value.

zeta(...): Compute the Hurwitz zeta function $$\zeta(x, q)$$.