neulab/docprompting-conala huggingface dataset:
tf.math.abs       View source on GitHub    Computes the absolute value of a tensor.  View aliases  Main aliases 
tf.abs Compat aliases for migration See Migration guide for more details. tf.compat.v1.abs, tf.compat.v1.math.abs  
tf.math.abs(
    x, name=None
)
 Given a tensor of integer or floating-point values, this operation returns a tensor of the same type, where each element contains the absolute value of the corresponding element in the input. Given a tensor x of complex numbers, this operation returns a tensor of type float32 or float64 that is the absolute value of each element in x. For a complex number \(a + bj\), its absolute value is computed as \(\sqrt{a^2 + b^2}\). For example: 
# real number
x = tf.constant([-2.25, 3.25])
tf.abs(x)
<tf.Tensor: shape=(2,), dtype=float32,
numpy=array([2.25, 3.25], dtype=float32)>
 
# complex number
x = tf.constant([[-2.25 + 4.75j], [-3.25 + 5.75j]])
tf.abs(x)
<tf.Tensor: shape=(2, 1), dtype=float64, numpy=
array([[5.25594901],
       [6.60492241]])>

 


 Args
  x   A Tensor or SparseTensor of type float16, float32, float64, int32, int64, complex64 or complex128.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor or SparseTensor of the same size, type and sparsity as x, with absolute values. Note, for complex64 or complex128 input, the returned Tensor will be of type float32 or float64, respectively. If x is a SparseTensor, returns SparseTensor(x.indices, tf.math.abs(x.values, ...), x.dense_shape)
tf.math.accumulate_n     View source on GitHub    Returns the element-wise sum of a list of tensors.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.accumulate_n, tf.compat.v1.math.accumulate_n  
tf.math.accumulate_n(
    inputs, shape=None, tensor_dtype=None, name=None
)
 Optionally, pass shape and tensor_dtype for shape and type checking, otherwise, these are inferred. accumulate_n performs the same operation as tf.math.add_n. For example: a = tf.constant([[1, 2], [3, 4]])
b = tf.constant([[5, 0], [0, 6]])
tf.math.accumulate_n([a, b, a])  # [[7, 4], [6, 14]]

# Explicitly pass shape and type
tf.math.accumulate_n([a, b, a], shape=[2, 2], tensor_dtype=tf.int32)
                                                               # [[7,  4],
                                                               #  [6, 14]]

 


 Args
  inputs   A list of Tensor objects, each with same shape and type.  
  shape   Expected shape of elements of inputs (optional). Also controls the output shape of this op, which may affect type inference in other ops. A value of None means "infer the input shape from the shapes in inputs".  
  tensor_dtype   Expected data type of inputs (optional). A value of None means "infer the input dtype from inputs[0]".  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of same shape and type as the elements of inputs.  

 


 Raises
  ValueError   If inputs don't all have same shape and dtype or the shape cannot be inferred.
tf.math.acos     View source on GitHub    Computes acos of x element-wise.  View aliases  Main aliases 
tf.acos Compat aliases for migration See Migration guide for more details. tf.compat.v1.acos, tf.compat.v1.math.acos  
tf.math.acos(
    x, name=None
)
 Provided an input tensor, the tf.math.acos operation returns the inverse cosine of each element of the tensor. If y = tf.math.cos(x) then, x = tf.math.acos(y). Input range is [-1, 1] and the output has a range of [0, pi]. For example: 
x = tf.constant([1.0, -0.5, 3.4, 0.2, 0.0, -2], dtype = tf.float32)
tf.math.acos(x)
<tf.Tensor: shape=(6,), dtype=float32,
numpy= array([0. , 2.0943952, nan, 1.3694383, 1.5707964, nan],
dtype=float32)>

 


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


 Returns   A Tensor. Has the same type as x.
tf.math.acosh Computes inverse hyperbolic cosine of x element-wise.  View aliases  Main aliases 
tf.acosh Compat aliases for migration See Migration guide for more details. tf.compat.v1.acosh, tf.compat.v1.math.acosh  
tf.math.acosh(
    x, name=None
)
 Given an input tensor, the function computes inverse hyperbolic cosine of every element. Input range is [1, inf]. It returns nan if the input lies outside the range. x = tf.constant([-2, -0.5, 1, 1.2, 200, 10000, float("inf")])
tf.math.acosh(x) ==> [nan nan 0. 0.62236255 5.9914584 9.903487 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.add Returns x + y element-wise.  View aliases  Main aliases 
tf.add Compat aliases for migration See Migration guide for more details. tf.compat.v1.add, tf.compat.v1.math.add  
tf.math.add(
    x, y, name=None
)
 
Note: math.add supports broadcasting. AddN does not. More about broadcasting here
 Given two input tensors, the tf.add operation computes the sum for every element in the tensor. Both input and output have a range (-inf, inf).
 


 Args
  x   A Tensor. Must be one of the following types: bfloat16, half, float32, float64, uint8, int8, int16, int32, int64, complex64, complex128, string.  
  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.add_n     View source on GitHub    Adds all input tensors element-wise.  View aliases  Main aliases 
tf.add_n Compat aliases for migration See Migration guide for more details. tf.compat.v1.add_n, tf.compat.v1.math.add_n  
tf.math.add_n(
    inputs, name=None
)
 tf.math.add_n performs the same operation as tf.math.accumulate_n, but it waits for all of its inputs to be ready before beginning to sum. This buffering can result in higher memory consumption when inputs are ready at different times, since the minimum temporary storage required is proportional to the input size rather than the output size. This op does not broadcast its inputs. If you need broadcasting, use tf.math.add (or the + operator) instead. For example: 
a = tf.constant([[3, 5], [4, 8]])
b = tf.constant([[1, 6], [2, 9]])
tf.math.add_n([a, b, a])
<tf.Tensor: shape=(2, 2), dtype=int32, numpy=
array([[ 7, 16],
       [10, 25]], dtype=int32)>

 


 Args
  inputs   A list of tf.Tensor or tf.IndexedSlices objects, each with the same shape and type. tf.IndexedSlices objects will be converted into dense tensors prior to adding.  
  name   A name for the operation (optional).   
 


 Returns   A tf.Tensor of the same shape and type as the elements of inputs.  

 


 Raises
  ValueError   If inputs don't all have same shape and dtype or the shape cannot be inferred.
tf.math.angle       View source on GitHub    Returns the element-wise argument of a complex (or real) tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.angle, tf.compat.v1.math.angle  
tf.math.angle(
    input, name=None
)
 Given a tensor input, this operation returns a tensor of type float that is the argument of each element in input considered as a complex number. The elements in input are considered to be complex numbers of the form \(a + bj\), where a is the real part and b is the imaginary part. If input is real then b is zero by definition. The argument returned by this function is of the form \(atan2(b, a)\). If input is real, a tensor of all zeros is returned. For example: input = tf.constant([-2.25 + 4.75j, 3.25 + 5.75j], dtype=tf.complex64)
tf.math.angle(input).numpy()
# ==> array([2.0131705, 1.056345 ], dtype=float32)

 


 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.
tf.math.argmax     View source on GitHub    Returns the index with the largest value across axes of a tensor.  View aliases  Main aliases 
tf.argmax  
tf.math.argmax(
    input, axis=None, output_type=tf.dtypes.int64, name=None
)
 In case of identity returns the smallest index. For example: 
A = tf.constant([2, 20, 30, 3, 6])
tf.math.argmax(A)  # A[2] is maximum in tensor A
<tf.Tensor: shape=(), dtype=int64, numpy=2>
B = tf.constant([[2, 20, 30, 3, 6], [3, 11, 16, 1, 8],
                 [14, 45, 23, 5, 27]])
tf.math.argmax(B, 0)
<tf.Tensor: shape=(5,), dtype=int64, numpy=array([2, 2, 0, 2, 2])>
tf.math.argmax(B, 1)
<tf.Tensor: shape=(3,), dtype=int64, numpy=array([2, 2, 1])>
C = tf.constant([0, 0, 0, 0])
tf.math.argmax(C) # Returns smallest index in case of ties
<tf.Tensor: shape=(), dtype=int64, numpy=0>

 


 Args
  input   A Tensor.  
  axis   An integer, the axis to reduce across. Default to 0.  
  output_type   An optional output dtype (tf.int32 or tf.int64). Defaults to tf.int64.  
  name   An optional name for the operation.   
 


 Returns   A Tensor of type output_type.
tf.math.argmin     View source on GitHub    Returns the index with the smallest value across axes of a tensor.  View aliases  Main aliases 
tf.argmin  
tf.math.argmin(
    input, axis=None, output_type=tf.dtypes.int64, name=None
)
 Returns the smallest index in case of ties.
 


 Args
  input   A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, complex64, int64, qint8, quint8, qint32, bfloat16, uint16, complex128, half, uint32, uint64.  
  axis   A Tensor. Must be one of the following types: int32, int64. int32 or int64, must be in the range -rank(input), rank(input)). Describes which axis of the input Tensor to reduce across. For vectors, use axis = 0.  
  output_type   An optional tf.DType from: tf.int32, tf.int64. Defaults to tf.int64.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type output_type.  
 Usage: import tensorflow as tf
a = [1, 10, 26.9, 2.8, 166.32, 62.3]
b = tf.math.argmin(input = a)
c = tf.keras.backend.eval(b)
# c = 0
# here a[0] = 1 which is the smallest element of a across axis 0
tf.math.asin Computes the trignometric inverse sine of x element-wise.  View aliases  Main aliases 
tf.asin Compat aliases for migration See Migration guide for more details. tf.compat.v1.asin, tf.compat.v1.math.asin  
tf.math.asin(
    x, name=None
)
 The tf.math.asin operation returns the inverse of tf.math.sin, such that if y = tf.math.sin(x) then, x = tf.math.asin(y). 
Note: The output of tf.math.asin will lie within the invertible range of sine, i.e [-pi/2, pi/2].
 For example: # Note: [1.047, 0.785] ~= [(pi/3), (pi/4)]
x = tf.constant([1.047, 0.785])
y = tf.math.sin(x) # [0.8659266, 0.7068252]

tf.math.asin(y) # [1.047, 0.785] = x

 


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


 Returns   A Tensor. Has the same type as x.
tf.math.asinh Computes inverse hyperbolic sine of x element-wise.  View aliases  Main aliases 
tf.asinh Compat aliases for migration See Migration guide for more details. tf.compat.v1.asinh, tf.compat.v1.math.asinh  
tf.math.asinh(
    x, name=None
)
 Given an input tensor, this function computes inverse hyperbolic sine for every element in the tensor. Both input and output has a range of [-inf, inf]. x = tf.constant([-float("inf"), -2, -0.5, 1, 1.2, 200, 10000, float("inf")])
tf.math.asinh(x) ==> [-inf -1.4436355 -0.4812118 0.8813736 1.0159732 5.991471 9.903487 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.atan Computes the trignometric inverse tangent of x element-wise.  View aliases  Main aliases 
tf.atan Compat aliases for migration See Migration guide for more details. tf.compat.v1.atan, tf.compat.v1.math.atan  
tf.math.atan(
    x, name=None
)
 The tf.math.atan operation returns the inverse of tf.math.tan, such that if y = tf.math.tan(x) then, x = tf.math.atan(y). 
Note: The output of tf.math.atan will lie within the invertible range of tan, i.e (-pi/2, pi/2).
 For example: # Note: [1.047, 0.785] ~= [(pi/3), (pi/4)]
x = tf.constant([1.047, 0.785])
y = tf.math.tan(x) # [1.731261, 0.99920404]

tf.math.atan(y) # [1.047, 0.785] = x

 


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


 Returns   A Tensor. Has the same type as x.
tf.math.atan2   Computes arctangent of y/x element-wise, respecting signs of the arguments.  View aliases  Main aliases 
tf.atan2 Compat aliases for migration See Migration guide for more details. tf.compat.v1.atan2, tf.compat.v1.math.atan2  
tf.math.atan2(
    y, x, name=None
)
 This is the angle ( \theta \in [-\pi, \pi] ) such that [ x = r \cos(\theta) ] and [ y = r \sin(\theta) ] where (r = \sqrt(x^2 + y^2) ).
 


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


 Returns   A Tensor. Has the same type as y.
tf.math.atanh Computes inverse hyperbolic tangent of x element-wise.  View aliases  Main aliases 
tf.atanh Compat aliases for migration See Migration guide for more details. tf.compat.v1.atanh, tf.compat.v1.math.atanh  
tf.math.atanh(
    x, name=None
)
 Given an input tensor, this function computes inverse hyperbolic tangent for every element in the tensor. Input range is [-1,1] and output range is [-inf, inf]. If input is -1, output will be -inf and if the input is 1, output will be inf. Values outside the range will have nan as output. x = tf.constant([-float("inf"), -1, -0.5, 1, 0, 0.5, 10, float("inf")])
tf.math.atanh(x) ==> [nan -inf -0.54930615 inf  0. 0.54930615 nan 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.bessel_i0     View source on GitHub    Computes the Bessel i0 function of x element-wise.  View aliases  Main aliases 
tf.math.special.bessel_i0 Compat aliases for migration See Migration guide for more details. tf.compat.v1.math.bessel_i0, tf.compat.v1.math.special.bessel_i0  
tf.math.bessel_i0(
    x, name=None
)
 Modified Bessel function of order 0. It is preferable to use the numerically stabler function i0e(x) instead. 
tf.math.special.bessel_i0([-1., -0.5, 0.5, 1.]).numpy()
array([1.26606588, 1.06348337, 1.06348337, 1.26606588], dtype=float32)

 


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


 Returns   A Tensor or SparseTensor, respectively. Has the same type as x.  
 Scipy Compatibility Equivalent to scipy.special.i0
tf.math.bessel_i0e     View source on GitHub    Computes the Bessel i0e function of x element-wise.  View aliases  Main aliases 
tf.math.special.bessel_i0e Compat aliases for migration See Migration guide for more details. tf.compat.v1.math.bessel_i0e, tf.compat.v1.math.special.bessel_i0e  
tf.math.bessel_i0e(
    x, name=None
)
 Modified Bessel function of order 0. 
tf.math.special.bessel_i0e([-1., -0.5, 0.5, 1.]).numpy()
array([0.46575961, 0.64503527, 0.64503527, 0.46575961], dtype=float32)

 


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


 Returns   A Tensor or SparseTensor, respectively. Has the same type as x. If x is a SparseTensor, returns SparseTensor(x.indices, tf.math.bessel_i0e(x.values, ...), x.dense_shape) 
 
 Scipy Compatibility Equivalent to scipy.special.i0e
tf.math.bessel_i1     View source on GitHub    Computes the Bessel i1 function of x element-wise.  View aliases  Main aliases 
tf.math.special.bessel_i1 Compat aliases for migration See Migration guide for more details. tf.compat.v1.math.bessel_i1, tf.compat.v1.math.special.bessel_i1  
tf.math.bessel_i1(
    x, name=None
)
 Modified Bessel function of order 1. It is preferable to use the numerically stabler function i1e(x) instead. 
tf.math.special.bessel_i1([-1., -0.5, 0.5, 1.]).numpy()
array([-0.5651591 , -0.25789431,  0.25789431,  0.5651591 ], dtype=float32)

 


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


 Returns   A Tensor or SparseTensor, respectively. Has the same type as x.  
 Scipy Compatibility Equivalent to scipy.special.i1
tf.math.bessel_i1e     View source on GitHub    Computes the Bessel i1e function of x element-wise.  View aliases  Main aliases 
tf.math.special.bessel_i1e Compat aliases for migration See Migration guide for more details. tf.compat.v1.math.bessel_i1e, tf.compat.v1.math.special.bessel_i1e  
tf.math.bessel_i1e(
    x, name=None
)
 Modified Bessel function of order 1. 
tf.math.special.bessel_i1e([-1., -0.5, 0.5, 1.]).numpy()
array([-0.20791042, -0.15642083,  0.15642083,  0.20791042], dtype=float32)

 


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


 Returns   A Tensor or SparseTensor, respectively. Has the same type as x. If x is a SparseTensor, returns SparseTensor(x.indices, tf.math.bessel_i1e(x.values, ...), x.dense_shape) 
 
 Scipy Compatibility Equivalent to scipy.special.i1e
tf.math.betainc   Compute the regularized incomplete beta integral \(I_x(a, b)\).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.betainc, tf.compat.v1.math.betainc  
tf.math.betainc(
    a, b, x, name=None
)
 The regularized incomplete beta integral is defined as: \(I_x(a, b) = \frac{B(x; a, b)}{B(a, b)}\) where \(B(x; a, b) = \int_0^x t^{a-1} (1 - t)^{b-1} dt\) is the incomplete beta function and \(B(a, b)\) is the complete beta function.
 


 Args
  a   A Tensor. Must be one of the following types: float32, float64.  
  b   A Tensor. Must have the same type as a.  
  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.bincount     View source on GitHub    Counts the number of occurrences of each value in an integer array. 
tf.math.bincount(
    arr, weights=None, minlength=None, maxlength=None, dtype=tf.dtypes.int32,
    name=None, axis=None, binary_output=False
)
 If minlength and maxlength are not given, returns a vector with length tf.reduce_max(arr) + 1 if arr is non-empty, and length 0 otherwise. If weights are non-None, then index i of the output stores the sum of the value in weights at each index where the corresponding value in arr is i. values = tf.constant([1,1,2,3,2,4,4,5])
tf.math.bincount(values) #[0 2 2 1 2 1]
 Vector length = Maximum element in vector values is 5. Adding 1, which is 6 will be the vector length. Each bin value in the output indicates number of occurrences of the particular index. Here, index 1 in output has a value 2. This indicates value 1 occurs two times in values. values = tf.constant([1,1,2,3,2,4,4,5])
weights = tf.constant([1,5,0,1,0,5,4,5])
tf.math.bincount(values, weights=weights) #[0 6 0 1 9 5]
 Bin will be incremented by the corresponding weight instead of 1. Here, index 1 in output has a value 6. This is the summation of weights corresponding to the value in values. Bin-counting on a certain axis This example takes a 2 dimensional input and returns a Tensor with bincounting on each sample. 
data = np.array([[1, 2, 3, 0], [0, 0, 1, 2]], dtype=np.int32)
tf.math.bincount(data, axis=-1)
<tf.Tensor: shape=(2, 4), dtype=int32, numpy=
  array([[1, 1, 1, 1],
         [2, 1, 1, 0]], dtype=int32)>
 Bin-counting with binary_output This example gives binary output instead of counting the occurrence. 
data = np.array([[1, 2, 3, 0], [0, 0, 1, 2]], dtype=np.int32)
tf.math.bincount(data, axis=-1, binary_output=True)
<tf.Tensor: shape=(2, 4), dtype=int32, numpy=
  array([[1, 1, 1, 1],
         [1, 1, 1, 0]], dtype=int32)>

 


 Args
  arr   A Tensor, RaggedTensor, or SparseTensor whose values should be counted. These tensors must have a rank of 2 if axis=-1.  
  weights   If non-None, must be the same shape as arr. For each value in arr, the bin will be incremented by the corresponding weight instead of 1.  
  minlength   If given, ensures the output has length at least minlength, padding with zeros at the end if necessary.  
  maxlength   If given, skips values in arr that are equal or greater than maxlength, ensuring that the output has length at most maxlength.  
  dtype   If weights is None, determines the type of the output bins.  
  name   A name scope for the associated operations (optional).  
  axis   The axis to slice over. Axes at and below axis will be flattened before bin counting. Currently, only 0, and -1 are supported. If None, all axes will be flattened (identical to passing 0).  
  binary_output   If True, this op will output 1 instead of the number of times a token appears (equivalent to one_hot + reduce_any instead of one_hot + reduce_add). Defaults to False.   
 


 Returns   A vector with the same dtype as weights or the given dtype. The bin values.  

 


 Raises   InvalidArgumentError if negative values are provided as an input.
tf.math.ceil     View source on GitHub    Return the ceiling of the input, element-wise.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.ceil, tf.compat.v1.math.ceil  
tf.math.ceil(
    x, name=None
)
 For example: 
tf.math.ceil([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
<tf.Tensor: shape=(7,), dtype=float32,
numpy=array([-1., -1., -0.,  1.,  2.,  2.,  2.], dtype=float32)>

 


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


 Returns   A tf.Tensor. Has the same type as x.  
 Numpy Compatibility Equivalent to np.ceil
tf.math.confusion_matrix     View source on GitHub    Computes the confusion matrix from predictions and labels. 
tf.math.confusion_matrix(
    labels, predictions, num_classes=None, weights=None, dtype=tf.dtypes.int32,
    name=None
)
 The matrix columns represent the prediction labels and the rows represent the real labels. The confusion matrix is always a 2-D array of shape [n, n], where n is the number of valid labels for a given classification task. Both prediction and labels must be 1-D arrays of the same shape in order for this function to work. If num_classes is None, then num_classes will be set to one plus the maximum value in either predictions or labels. Class labels are expected to start at 0. For example, if num_classes is 3, then the possible labels would be [0, 1, 2]. If weights is not None, then each prediction contributes its corresponding weight to the total value of the confusion matrix cell. For example: tf.math.confusion_matrix([1, 2, 4], [2, 2, 4]) ==>
    [[0 0 0 0 0]
     [0 0 1 0 0]
     [0 0 1 0 0]
     [0 0 0 0 0]
     [0 0 0 0 1]]
 Note that the possible labels are assumed to be [0, 1, 2, 3, 4], resulting in a 5x5 confusion matrix.
 


 Args
  labels   1-D Tensor of real labels for the classification task.  
  predictions   1-D Tensor of predictions for a given classification.  
  num_classes   The possible number of labels the classification task can have. If this value is not provided, it will be calculated using both predictions and labels array.  
  weights   An optional Tensor whose shape matches predictions.  
  dtype   Data type of the confusion matrix.  
  name   Scope name.   
 


 Returns   A Tensor of type dtype with shape [n, n] representing the confusion matrix, where n is the number of possible labels in the classification task.  

 


 Raises
  ValueError   If both predictions and labels are not 1-D vectors and have mismatched shapes, or if weights is not None and its shape doesn't match predictions.