neulab/docprompting-conala huggingface dataset:
tf.math.conj       View source on GitHub    Returns the complex conjugate of a complex number.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.conj, tf.compat.v1.math.conj  
tf.math.conj(
    x, name=None
)
 Given a tensor x of complex numbers, this operation returns a tensor of complex numbers that are the complex conjugate of each element in x. The complex numbers in x must be of the form \(a + bj\), where a is the real part and b is the imaginary part. The complex conjugate returned by this operation is of the form \(a - bj\). For example: 
x = tf.constant([-2.25 + 4.75j, 3.25 + 5.75j])
tf.math.conj(x)
<tf.Tensor: shape=(2,), dtype=complex128,
numpy=array([-2.25-4.75j,  3.25-5.75j])>
 If x is real, it is returned unchanged. For example: 
x = tf.constant([-2.25, 3.25])
tf.math.conj(x)
<tf.Tensor: shape=(2,), dtype=float32,
numpy=array([-2.25,  3.25], dtype=float32)>

 


 Args
  x   Tensor to conjugate. Must have numeric or variant type.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor that is the conjugate of x (with the same type).  

 


 Raises
  TypeError   If x is not a numeric tensor.    Numpy Compatibility Equivalent to numpy.conj.
tf.math.cos Computes cos of x element-wise.  View aliases  Main aliases 
tf.cos Compat aliases for migration See Migration guide for more details. tf.compat.v1.cos, tf.compat.v1.math.cos  
tf.math.cos(
    x, name=None
)
 Given an input tensor, this function computes cosine of every element in the tensor. Input range is (-inf, inf) and output range is [-1,1]. If input lies outside the boundary, nan is returned. x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 200, 10000, float("inf")])
tf.math.cos(x) ==> [nan -0.91113025 0.87758255 0.5403023 0.36235774 0.48718765 -0.95215535 nan]

 


 Args
  x   A Tensor. Must be one of the following types: bfloat16, half, float32, float64, complex64, complex128.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as x.
tf.math.cosh Computes hyperbolic cosine of x element-wise.  View aliases  Main aliases 
tf.cosh Compat aliases for migration See Migration guide for more details. tf.compat.v1.cosh, tf.compat.v1.math.cosh  
tf.math.cosh(
    x, name=None
)
 Given an input tensor, this function computes hyperbolic cosine of every element in the tensor. Input range is [-inf, inf] and output range is [1, inf]. x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 2, 10, float("inf")])
tf.math.cosh(x) ==> [inf 4.0515420e+03 1.1276259e+00 1.5430807e+00 1.8106556e+00 3.7621956e+00 1.1013233e+04 inf]

 


 Args
  x   A Tensor. Must be one of the following types: bfloat16, half, float32, float64, complex64, complex128.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as x.
tf.math.count_nonzero     View source on GitHub    Computes number of nonzero elements across dimensions of a tensor. 
tf.math.count_nonzero(
    input, axis=None, keepdims=None, dtype=tf.dtypes.int64, name=None
)
 Reduces input along the dimensions given in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each entry in axis. If keepdims is true, the reduced dimensions are retained with length 1. If axis has no entries, all dimensions are reduced, and a tensor with a single element is returned. 
Note: Floating point comparison to zero is done by exact floating point equality check. Small values are not rounded to zero for purposes of the nonzero check.
 For example: x = tf.constant([[0, 1, 0], [1, 1, 0]])
tf.math.count_nonzero(x)  # 3
tf.math.count_nonzero(x, 0)  # [1, 2, 0]
tf.math.count_nonzero(x, 1)  # [1, 2]
tf.math.count_nonzero(x, 1, keepdims=True)  # [[1], [2]]
tf.math.count_nonzero(x, [0, 1])  # 3


Note: Strings are compared against zero-length empty string "". Any string with a size greater than zero is already considered as nonzero.
 For example: x = tf.constant(["", "a", "  ", "b", ""])
tf.math.count_nonzero(x) # 3, with "a", "  ", and "b" as nonzero strings.

 


 Args
  input   The tensor to reduce. Should be of numeric type, bool, or string.  
  axis   The dimensions to reduce. If None (the default), reduces all dimensions. Must be in the range [-rank(input), rank(input)).  
  keepdims   If true, retains reduced dimensions with length 1.  
  dtype   The output dtype; defaults to tf.int64.  
  name   A name for the operation (optional).   
 


 Returns   The reduced tensor (number of nonzero values).
tf.math.cumprod     View source on GitHub    Compute the cumulative product of the tensor x along axis.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.cumprod, tf.compat.v1.math.cumprod  
tf.math.cumprod(
    x, axis=0, exclusive=False, reverse=False, name=None
)
 By default, this op performs an inclusive cumprod, which means that the first element of the input is identical to the first element of the output: tf.math.cumprod([a, b, c])  # [a, a * b, a * b * c]
 By setting the exclusive kwarg to True, an exclusive cumprod is performed instead: tf.math.cumprod([a, b, c], exclusive=True)  # [1, a, a * b]
 By setting the reverse kwarg to True, the cumprod is performed in the opposite direction: tf.math.cumprod([a, b, c], reverse=True)  # [a * b * c, b * c, c]
 This is more efficient than using separate tf.reverse ops. The reverse and exclusive kwargs can also be combined: tf.math.cumprod([a, b, c], exclusive=True, reverse=True)  # [b * c, c, 1]

 


 Args
  x   A Tensor. Must be one of the following types: float32, float64, int64, int32, uint8, uint16, int16, int8, complex64, complex128, qint8, quint8, qint32, half.  
  axis   A Tensor of type int32 (default: 0). Must be in the range [-rank(x), rank(x)).  
  exclusive   If True, perform exclusive cumprod.  
  reverse   A bool (default: False).  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as x.
tf.math.cumsum     View source on GitHub    Compute the cumulative sum of the tensor x along axis.  View aliases  Main aliases 
tf.cumsum Compat aliases for migration See Migration guide for more details. tf.compat.v1.cumsum, tf.compat.v1.math.cumsum  
tf.math.cumsum(
    x, axis=0, exclusive=False, reverse=False, name=None
)
 By default, this op performs an inclusive cumsum, which means that the first element of the input is identical to the first element of the output: For example: 
# tf.cumsum([a, b, c])   # [a, a + b, a + b + c]
x = tf.constant([2, 4, 6, 8])
tf.cumsum(x)
<tf.Tensor: shape=(4,), dtype=int32,
numpy=array([ 2,  6, 12, 20], dtype=int32)>
 
# using varying `axis` values
y = tf.constant([[2, 4, 6, 8], [1,3,5,7]])
tf.cumsum(y, axis=0)
<tf.Tensor: shape=(2, 4), dtype=int32, numpy=
array([[ 2,  4,  6,  8],
       [ 3,  7, 11, 15]], dtype=int32)>
tf.cumsum(y, axis=1)
<tf.Tensor: shape=(2, 4), dtype=int32, numpy=
array([[ 2,  6, 12, 20],
       [ 1,  4,  9, 16]], dtype=int32)>
 By setting the exclusive kwarg to True, an exclusive cumsum is performed instead: 
# tf.cumsum([a, b, c], exclusive=True)  => [0, a, a + b]
x = tf.constant([2, 4, 6, 8])
tf.cumsum(x, exclusive=True)
<tf.Tensor: shape=(4,), dtype=int32,
numpy=array([ 0,  2,  6, 12], dtype=int32)>
 By setting the reverse kwarg to True, the cumsum is performed in the opposite direction: 
# tf.cumsum([a, b, c], reverse=True)  # [a + b + c, b + c, c]
x = tf.constant([2, 4, 6, 8])
tf.cumsum(x, reverse=True)
<tf.Tensor: shape=(4,), dtype=int32,
numpy=array([20, 18, 14,  8], dtype=int32)>
 This is more efficient than using separate tf.reverse ops. The reverse and exclusive kwargs can also be combined: 
# tf.cumsum([a, b, c], exclusive=True, reverse=True)  # [b + c, c, 0]
x = tf.constant([2, 4, 6, 8])
tf.cumsum(x, exclusive=True, reverse=True)
<tf.Tensor: shape=(4,), dtype=int32,
numpy=array([18, 14,  8,  0], dtype=int32)>

 


 Args
  x   A Tensor. Must be one of the following types: float32, float64, int64, int32, uint8, uint16, int16, int8, complex64, complex128, qint8, quint8, qint32, half.  
  axis   A Tensor of type int32 (default: 0). Must be in the range [-rank(x), rank(x)).  
  exclusive   If True, perform exclusive cumsum.  
  reverse   A bool (default: False).  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as x.
tf.math.cumulative_logsumexp     View source on GitHub    Compute the cumulative log-sum-exp of the tensor x along axis.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.cumulative_logsumexp  
tf.math.cumulative_logsumexp(
    x, axis=0, exclusive=False, reverse=False, name=None
)
 By default, this op performs an inclusive cumulative log-sum-exp, which means that the first element of the input is identical to the first element of the output. This operation is significantly more numerically stable than the equivalent tensorflow operation tf.math.log(tf.math.cumsum(tf.math.exp(x))), although computes the same result given infinite numerical precision. However, note that in some cases, it may be less stable than tf.math.reduce_logsumexp for a given element, as it applies the "log-sum-exp trick" in a different way. More precisely, where tf.math.reduce_logsumexp uses the following trick: log(sum(exp(x))) == log(sum(exp(x - max(x)))) + max(x)
 it cannot be directly used here as there is no fast way of applying it to each prefix x[:i]. Instead, this function implements a prefix scan using pairwise log-add-exp, which is a commutative and associative (up to floating point precision) operator: log_add_exp(x, y) = log(exp(x) + exp(y))
                  = log(1 + exp(min(x, y) - max(x, y))) + max(x, y)
 However, reducing using the above operator leads to a different computation tree (logs are taken repeatedly instead of only at the end), and the maximum is only computed pairwise instead of over the entire prefix. In general, this leads to a different and slightly less precise computation.
 


 Args
  x   A Tensor. Must be one of the following types: float16, float32, float64.  
  axis   A Tensor of type int32 or int64 (default: 0). Must be in the range [-rank(x), rank(x)).  
  exclusive   If True, perform exclusive cumulative log-sum-exp.  
  reverse   If True, performs the cumulative log-sum-exp in the reverse direction.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same shape and type as x.
tf.math.digamma Computes Psi, the derivative of Lgamma (the log of the absolute value of  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.digamma, tf.compat.v1.math.digamma  
tf.math.digamma(
    x, name=None
)
 Gamma(x)), element-wise.
 


 Args
  x   A Tensor. Must be one of the following types: bfloat16, half, float32, float64.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as x.
tf.math.divide     View source on GitHub    Computes Python style division of x by y.  View aliases  Main aliases 
tf.divide Compat aliases for migration See Migration guide for more details. tf.compat.v1.divide, tf.compat.v1.math.divide  
tf.math.divide(
    x, y, name=None
)
 For example: 
x = tf.constant([16, 12, 11])
y = tf.constant([4, 6, 2])
tf.divide(x,y)
<tf.Tensor: shape=(3,), dtype=float64,
numpy=array([4. , 2. , 5.5])>

 


 Args
  x   A Tensor  
  y   A Tensor  
  name   A name for the operation (optional).   
 


 Returns   A Tensor with same shape as input
tf.math.divide_no_nan     View source on GitHub    Computes a safe divide which returns 0 if the y is zero.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.div_no_nan, tf.compat.v1.math.divide_no_nan  
tf.math.divide_no_nan(
    x, y, name=None
)

 


 Args
  x   A Tensor. Must be one of the following types: float32, float64.  
  y   A Tensor whose dtype is compatible with x.  
  name   A name for the operation (optional).   
 


 Returns   The element-wise value of the x divided by y.
tf.math.equal     View source on GitHub    Returns the truth value of (x == y) element-wise.  View aliases  Main aliases 
tf.equal Compat aliases for migration See Migration guide for more details. tf.compat.v1.equal, tf.compat.v1.math.equal  
tf.math.equal(
    x, y, name=None
)
 Performs a broadcast with the arguments and then an element-wise equality comparison, returning a Tensor of boolean values. For example: 
x = tf.constant([2, 4])
y = tf.constant(2)
tf.math.equal(x, y)
<tf.Tensor: shape=(2,), dtype=bool, numpy=array([ True,  False])>
 
x = tf.constant([2, 4])
y = tf.constant([2, 4])
tf.math.equal(x, y)
<tf.Tensor: shape=(2,), dtype=bool, numpy=array([ True,  True])>

 


 Args
  x   A tf.Tensor or tf.sparse.SparseTensor or tf.IndexedSlices.  
  y   A tf.Tensor or tf.sparse.SparseTensor or tf.IndexedSlices.  
  name   A name for the operation (optional).   
 


 Returns   A tf.Tensor of type bool with the same size as that of x or y.  

 


 Raises   tf.errors.InvalidArgumentError: If shapes of arguments are incompatible
tf.math.erf Computes the Gauss error function of x element-wise.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.erf, tf.compat.v1.math.erf  
tf.math.erf(
    x, name=None
)

 


 Args
  x   A Tensor. Must be one of the following types: bfloat16, half, float32, float64.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as x. If x is a SparseTensor, returns SparseTensor(x.indices, tf.math.erf(x.values, ...), x.dense_shape)
tf.math.erfc Computes the complementary error function of x element-wise.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.erfc, tf.compat.v1.math.erfc  
tf.math.erfc(
    x, name=None
)

 


 Args
  x   A Tensor. Must be one of the following types: bfloat16, half, float32, float64.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as x.
tf.math.erfcinv Computes the inverse of complementary error function.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.erfcinv  
tf.math.erfcinv(
    x, name=None
)
 Given x, compute the inverse complementary error function of x. This function is the inverse of tf.math.erfc, and is defined on [0, 2]. 
tf.math.erfcinv([0., 0.2, 1., 1.5, 2.])
<tf.Tensor: shape=(5,), dtype=float32, numpy=
array([       inf,  0.9061935, -0.       , -0.4769363,       -inf],
      dtype=float32)>

 


 Args
  x   Tensor with type float or double.  
  name   A name for the operation (optional).   
 


 Returns   Inverse complementary error function of x.  
 Numpy Compatibility Equivalent to scipy.special.erfcinv
tf.math.erfinv Compute inverse error function.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.erfinv  
tf.math.erfinv(
    x, name=None
)
 Given x, compute the inverse error function of x. This function is the inverse of tf.math.erf.
 


 Args
  x   Tensor with type float or double.  
  name   A name for the operation (optional).   
 


 Returns   Inverse error function of x.
tf.math.exp       View source on GitHub    Computes exponential of x element-wise. \(y = e^x\).  View aliases  Main aliases 
tf.exp Compat aliases for migration See Migration guide for more details. tf.compat.v1.exp, tf.compat.v1.math.exp  
tf.math.exp(
    x, name=None
)
 This function computes the exponential of the input tensor element-wise. i.e. math.exp(x) or \(e^x\), where x is the input tensor. \(e\) denotes Euler's number and is approximately equal to 2.718281. Output is positive for any real input. 
x = tf.constant(2.0)
tf.math.exp(x)
<tf.Tensor: shape=(), dtype=float32, numpy=7.389056>
 
x = tf.constant([2.0, 8.0])
tf.math.exp(x)
<tf.Tensor: shape=(2,), dtype=float32,
numpy=array([   7.389056, 2980.958   ], dtype=float32)>
 For complex numbers, the exponential value is calculated as  $$ e^{x+iy} = {e^x} {e^{iy} } = {e^x} ({\cos (y) + i \sin (y)}) $$  For 1+1j the value would be computed as:  $$ e^1 (\cos (1) + i \sin (1)) = 2.7182817 \times (0.5403023+0.84147096j) $$  
x = tf.constant(1 + 1j)
tf.math.exp(x)
<tf.Tensor: shape=(), dtype=complex128,
numpy=(1.4686939399158851+2.2873552871788423j)>

 


 Args
  x   A tf.Tensor. Must be one of the following types: bfloat16, half, float32, float64, complex64, complex128.  
  name   A name for the operation (optional).   
 


 Returns   A tf.Tensor. Has the same type as x.  
 Numpy Compatibility Equivalent to np.exp
tf.math.expm1 Computes exp(x) - 1 element-wise.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.expm1, tf.compat.v1.math.expm1  
tf.math.expm1(
    x, name=None
)
 i.e. exp(x) - 1 or e^(x) - 1, where x is the input tensor. e denotes Euler's number and is approximately equal to 2.718281. x = tf.constant(2.0)
tf.math.expm1(x) ==> 6.389056

x = tf.constant([2.0, 8.0])
tf.math.expm1(x) ==> array([6.389056, 2979.958], dtype=float32)

x = tf.constant(1 + 1j)
tf.math.expm1(x) ==> (0.46869393991588515+2.2873552871788423j)

 


 Args
  x   A Tensor. Must be one of the following types: bfloat16, half, float32, float64, complex64, complex128.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as x.
tf.math.floor     View source on GitHub    Returns element-wise largest integer not greater than x.  View aliases  Main aliases 
tf.floor Compat aliases for migration See Migration guide for more details. tf.compat.v1.floor, tf.compat.v1.math.floor  
tf.math.floor(
    x, name=None
)
 Both input range is (-inf, inf) and the ouput range consists of all integer values. For example: 
x = tf.constant([1.3324, -1.5, 5.555, -2.532, 0.99, float("inf")])
tf.floor(x).numpy()
array([ 1., -2.,  5., -3.,  0., inf], dtype=float32)

 


 Args
  x   A Tensor. Must be one of the following types: bfloat16, half, float32, float64.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as x.
tf.math.floordiv     View source on GitHub    Divides x / y elementwise, rounding toward the most negative integer.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.floordiv, tf.compat.v1.math.floordiv  
tf.math.floordiv(
    x, y, name=None
)
 The same as tf.compat.v1.div(x,y) for integers, but uses tf.floor(tf.compat.v1.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. x and y must have the same type, and the result will have the same type as well.
 


 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 rounded down.  

 


 Raises
  TypeError   If the inputs are complex.
tf.math.floormod Returns element-wise remainder of division. When x < 0 xor y < 0 is  View aliases  Main aliases 
tf.math.mod Compat aliases for migration See Migration guide for more details. tf.compat.v1.floormod, tf.compat.v1.math.floormod, tf.compat.v1.math.mod, tf.compat.v1.mod  
tf.math.floormod(
    x, y, name=None
)
 true, this follows Python semantics in that the result here is consistent with a flooring divide. E.g. floor(x / y) * y + mod(x, y) = x. 
Note: math.floormod supports broadcasting. More about broadcasting here

 


 Args
  x   A Tensor. Must be one of the following types: int32, int64, uint64, bfloat16, half, float32, float64.  
  y   A Tensor. Must have the same type as x.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as x.
tf.math.greater Returns the truth value of (x > y) element-wise.  View aliases  Main aliases 
tf.greater Compat aliases for migration See Migration guide for more details. tf.compat.v1.greater, tf.compat.v1.math.greater  
tf.math.greater(
    x, y, name=None
)
 
Note: math.greater supports broadcasting. More about broadcasting here
 Example: x = tf.constant([5, 4, 6])
y = tf.constant([5, 2, 5])
tf.math.greater(x, y) ==> [False, True, True]

x = tf.constant([5, 4, 6])
y = tf.constant([5])
tf.math.greater(x, y) ==> [False, False, True]

 


 Args
  x   A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64.  
  y   A Tensor. Must have the same type as x.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type bool.
tf.math.greater_equal Returns the truth value of (x >= y) element-wise.  View aliases  Main aliases 
tf.greater_equal Compat aliases for migration See Migration guide for more details. tf.compat.v1.greater_equal, tf.compat.v1.math.greater_equal  
tf.math.greater_equal(
    x, y, name=None
)
 
Note: math.greater_equal supports broadcasting. More about broadcasting here
 Example: x = tf.constant([5, 4, 6, 7])
y = tf.constant([5, 2, 5, 10])
tf.math.greater_equal(x, y) ==> [True, True, True, False]

x = tf.constant([5, 4, 6, 7])
y = tf.constant([5])
tf.math.greater_equal(x, y) ==> [True, False, True, True]

 


 Args
  x   A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64.  
  y   A Tensor. Must have the same type as x.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type bool.
tf.math.igamma   Compute the lower regularized incomplete Gamma function P(a, x).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.igamma, tf.compat.v1.math.igamma  
tf.math.igamma(
    a, x, name=None
)
 The lower regularized incomplete Gamma function is defined as: \(P(a, x) = gamma(a, x) / Gamma(a) = 1 - Q(a, x)\) where \(gamma(a, x) = \\int_{0}^{x} t^{a-1} exp(-t) dt\) is the lower incomplete Gamma function. Note, above Q(a, x) (Igammac) is the upper regularized complete Gamma function.
 


 Args
  a   A Tensor. Must be one of the following types: float32, float64.  
  x   A Tensor. Must have the same type as a.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as a.
tf.math.igammac   Compute the upper regularized incomplete Gamma function Q(a, x).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.igammac, tf.compat.v1.math.igammac  
tf.math.igammac(
    a, x, name=None
)
 The upper regularized incomplete Gamma function is defined as: \(Q(a, x) = Gamma(a, x) / Gamma(a) = 1 - P(a, x)\) where \(Gamma(a, x) = int_{x}^{\infty} t^{a-1} exp(-t) dt\) is the upper incomplete Gama function. Note, above P(a, x) (Igamma) is the lower regularized complete Gamma function.
 


 Args
  a   A Tensor. Must be one of the following types: float32, float64.  
  x   A Tensor. Must have the same type as a.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as a.
tf.math.imag     View source on GitHub    Returns the imaginary part of a complex (or real) tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.imag, tf.compat.v1.math.imag  
tf.math.imag(
    input, name=None
)
 Given a tensor input, this operation returns a tensor of type float that is the imaginary part of each element in input considered as a complex number. If input is real, a tensor of all zeros is returned. For example: x = tf.constant([-2.25 + 4.75j, 3.25 + 5.75j])
tf.math.imag(x)  # [4.75, 5.75]

 


 Args
  input   A Tensor. Must be one of the following types: float, double, complex64, complex128.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type float32 or float64.