neulab/docprompting-conala huggingface dataset:
tf.math.square   Computes square of x element-wise.  View aliases  Main aliases 
tf.square Compat aliases for migration See Migration guide for more details. tf.compat.v1.math.square, tf.compat.v1.square  
tf.math.square(
    x, name=None
)
 I.e., \(y = x * x = x^2\). 
tf.math.square([-2., 0., 3.])
<tf.Tensor: shape=(3,), dtype=float32, numpy=array([4., 0., 9.], dtype=float32)>

 


 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. If x is a SparseTensor, returns SparseTensor(x.indices, tf.math.square(x.values, ...), x.dense_shape)
tf.math.squared_difference Returns conj(x - y)(x - y) element-wise.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.squared_difference, tf.compat.v1.squared_difference  
tf.math.squared_difference(
    x, y, name=None
)
 
Note: math.squared_difference supports broadcasting. More about broadcasting here

 


 Args
  x   A Tensor. Must be one of the following types: bfloat16, half, float32, float64, int32, int64, complex64, complex128.  
  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.subtract     View source on GitHub    Returns x - y element-wise.  View aliases  Main aliases 
tf.subtract Compat aliases for migration See Migration guide for more details. tf.compat.v1.math.subtract, tf.compat.v1.subtract  
tf.math.subtract(
    x, y, name=None
)
 
Note: Subtract supports broadcasting. More about broadcasting here

 


 Args
  x   A Tensor. Must be one of the following types: bfloat16, half, float32, float64, uint8, int8, uint16, int16, int32, int64, complex64, complex128, uint32.  
  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.tan Computes tan of x element-wise.  View aliases  Main aliases 
tf.tan Compat aliases for migration See Migration guide for more details. tf.compat.v1.math.tan, tf.compat.v1.tan  
tf.math.tan(
    x, name=None
)
 Given an input tensor, this function computes tangent of every element in the tensor. Input range is (-inf, inf) and output range is (-inf, inf). 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.tan(x) ==> [nan 0.45231566 -0.5463025 1.5574077 2.572152 -1.7925274 0.32097113 nan]

 


 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.tanh Computes hyperbolic tangent of x element-wise.  View aliases  Main aliases 
tf.nn.tanh, tf.tanh Compat aliases for migration See Migration guide for more details. tf.compat.v1.math.tanh, tf.compat.v1.nn.tanh, tf.compat.v1.tanh  
tf.math.tanh(
    x, name=None
)
 Given an input tensor, this function computes hyperbolic tangent of every element in the tensor. Input range is [-inf, inf] and output range is [-1,1]. 
x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")])
tf.math.tanh(x)
  <tf.Tensor: shape=(8,), dtype=float32, numpy=
  array([-1.        , -0.99990916, -0.46211717,  0.7615942 ,  0.8336547 ,
          0.9640276 ,  0.9950547 ,  1.        ], dtype=float32)>
  

 


 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. If x is a SparseTensor, returns SparseTensor(x.indices, tf.math.tanh(x.values, ...), x.dense_shape)
tf.math.top_k     View source on GitHub    Finds values and indices of the k largest entries for the last dimension.  View aliases  Main aliases 
tf.nn.top_k Compat aliases for migration See Migration guide for more details. tf.compat.v1.math.top_k, tf.compat.v1.nn.top_k  
tf.math.top_k(
    input, k=1, sorted=True, name=None
)
 If the input is a vector (rank=1), finds the k largest entries in the vector and outputs their values and indices as vectors. Thus values[j] is the j-th largest entry in input, and its index is indices[j]. For matrices (resp. higher rank input), computes the top k entries in each row (resp. vector along the last dimension). Thus, values.shape = indices.shape = input.shape[:-1] + [k]
 If two elements are equal, the lower-index element appears first.
 


 Args
  input   1-D or higher Tensor with last dimension at least k.  
  k   0-D int32 Tensor. Number of top elements to look for along the last dimension (along each row for matrices).  
  sorted   If true the resulting k elements will be sorted by the values in descending order.  
  name   Optional name for the operation.   
 


 Returns
  values   The k largest elements along each last dimensional slice.  
  indices   The indices of values within the last dimension of input.
tf.math.truediv     View source on GitHub    Divides x / y elementwise (using Python 3 division operator semantics).  View aliases  Main aliases 
tf.truediv Compat aliases for migration See Migration guide for more details. tf.compat.v1.math.truediv, tf.compat.v1.truediv  
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   Tensor numerator of numeric type.  
  y   Tensor denominator of numeric type.  
  name   A name for the operation (optional).   
 


 Returns   x / y evaluated in floating point.  

 


 Raises
  TypeError   If x and y have different dtypes.
tf.math.unsorted_segment_max   Computes the maximum along segments of a tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.unsorted_segment_max, tf.compat.v1.unsorted_segment_max  
tf.math.unsorted_segment_max(
    data, segment_ids, num_segments, name=None
)
 Read the section on segmentation for an explanation of segments. This operator is similar to the unsorted segment sum operator found (here). Instead of computing the sum over segments, it computes the maximum such that: \(output_i = \max_{j...} data[j...]\) where max is over tuples j... such that segment_ids[j...] == i. If the maximum is empty for a given segment ID i, it outputs the smallest possible value for the specific numeric type, output[i] = numeric_limits<T>::lowest(). If the given segment ID i is negative, then the corresponding value is dropped, and will not be included in the result.    For example: c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
tf.unsorted_segment_max(c, tf.constant([0, 1, 0]), num_segments=2)
# ==> [[ 4,  3, 3, 4],
#       [5,  6, 7, 8]]

 


 Args
  data   A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64.  
  segment_ids   A Tensor. Must be one of the following types: int32, int64. A tensor whose shape is a prefix of data.shape.  
  num_segments   A Tensor. Must be one of the following types: int32, int64.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as data.
tf.math.unsorted_segment_mean       View source on GitHub    Computes the mean along segments of a tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.unsorted_segment_mean, tf.compat.v1.unsorted_segment_mean  
tf.math.unsorted_segment_mean(
    data, segment_ids, num_segments, name=None
)
 Read the section on segmentation for an explanation of segments. This operator is similar to the tf.math.unsorted_segment_sum operator. Instead of computing the sum over segments, it computes the mean of all entries belonging to a segment such that: \(output_i = 1/N_i \sum_{j...} data[j...]\) where the sum is over tuples j... such that segment_ids[j...] == i with \N_i\ being the number of occurrences of id \i\. If there is no entry for a given segment ID i, it outputs 0. If the given segment ID i is negative, the value is dropped and will not be added to the sum of the segment.
 


 Args
  data   A Tensor with floating point or complex dtype.  
  segment_ids   An integer tensor whose shape is a prefix of data.shape.  
  num_segments   An integer scalar Tensor. The number of distinct segment IDs.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has same shape as data, except for the first segment_ids.rank dimensions, which are replaced with a single dimension which has size num_segments.
tf.math.unsorted_segment_min   Computes the minimum along segments of a tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.unsorted_segment_min, tf.compat.v1.unsorted_segment_min  
tf.math.unsorted_segment_min(
    data, segment_ids, num_segments, name=None
)
 Read the section on segmentation for an explanation of segments. This operator is similar to the unsorted segment sum operator found (here). Instead of computing the sum over segments, it computes the minimum such that: \(output_i = \min_{j...} data_[j...]\) where min is over tuples j... such that segment_ids[j...] == i. If the minimum is empty for a given segment ID i, it outputs the largest possible value for the specific numeric type, output[i] = numeric_limits<T>::max(). For example: c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
tf.unsorted_segment_min(c, tf.constant([0, 1, 0]), num_segments=2)
# ==> [[ 1,  2, 2, 1],
#       [5,  6, 7, 8]]
 If the given segment ID i is negative, then the corresponding value is dropped, and will not be included in the result.
 


 Args
  data   A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64.  
  segment_ids   A Tensor. Must be one of the following types: int32, int64. A tensor whose shape is a prefix of data.shape.  
  num_segments   A Tensor. Must be one of the following types: int32, int64.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as data.
tf.math.unsorted_segment_prod   Computes the product along segments of a tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.unsorted_segment_prod, tf.compat.v1.unsorted_segment_prod  
tf.math.unsorted_segment_prod(
    data, segment_ids, num_segments, name=None
)
 Read the section on segmentation for an explanation of segments. This operator is similar to the unsorted segment sum operator found (here). Instead of computing the sum over segments, it computes the product of all entries belonging to a segment such that: \(output_i = \prod_{j...} data[j...]\) where the product is over tuples j... such that segment_ids[j...] == i. For example: c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
tf.unsorted_segment_prod(c, tf.constant([0, 1, 0]), num_segments=2)
# ==> [[ 4,  6, 6, 4],
#       [5,  6, 7, 8]]
 If there is no entry for a given segment ID i, it outputs 1. If the given segment ID i is negative, then the corresponding value is dropped, and will not be included in the result.
 


 Args
  data   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.  
  segment_ids   A Tensor. Must be one of the following types: int32, int64. A tensor whose shape is a prefix of data.shape.  
  num_segments   A Tensor. Must be one of the following types: int32, int64.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as data.
tf.math.unsorted_segment_sqrt_n       View source on GitHub    Computes the sum along segments of a tensor divided by the sqrt(N).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.unsorted_segment_sqrt_n, tf.compat.v1.unsorted_segment_sqrt_n  
tf.math.unsorted_segment_sqrt_n(
    data, segment_ids, num_segments, name=None
)
 Read the section on segmentation for an explanation of segments. This operator is similar to the tf.math.unsorted_segment_sum operator. Additionally to computing the sum over segments, it divides the results by sqrt(N). \(output_i = 1/sqrt(N_i) \sum_{j...} data[j...]\) where the sum is over tuples j... such that segment_ids[j...] == i with \N_i\ being the number of occurrences of id \i\. If there is no entry for a given segment ID i, it outputs 0. Note that this op only supports floating point and complex dtypes, due to tf.sqrt only supporting these types. If the given segment ID i is negative, the value is dropped and will not be added to the sum of the segment.
 


 Args
  data   A Tensor with floating point or complex dtype.  
  segment_ids   An integer tensor whose shape is a prefix of data.shape.  
  num_segments   An integer scalar Tensor. The number of distinct segment IDs.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has same shape as data, except for the first segment_ids.rank dimensions, which are replaced with a single dimension which has size num_segments.
tf.math.unsorted_segment_sum   Computes the sum along segments of a tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.unsorted_segment_sum, tf.compat.v1.unsorted_segment_sum  
tf.math.unsorted_segment_sum(
    data, segment_ids, num_segments, name=None
)
 Read the section on segmentation for an explanation of segments. Computes a tensor such that \(output[i] = \sum_{j...} data[j...]\) where the sum is over tuples j... such that segment_ids[j...] == i. Unlike SegmentSum, segment_ids need not be sorted and need not cover all values in the full range of valid values. If the sum is empty for a given segment ID i, output[i] = 0. If the given segment ID i is negative, the value is dropped and will not be added to the sum of the segment. num_segments should equal the number of distinct segment IDs.    c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
tf.unsorted_segment_sum(c, tf.constant([0, 1, 0]), num_segments=2)
# ==> [[ 5,  5, 5, 5],
#       [5,  6, 7, 8]]

 


 Args
  data   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.  
  segment_ids   A Tensor. Must be one of the following types: int32, int64. A tensor whose shape is a prefix of data.shape.  
  num_segments   A Tensor. Must be one of the following types: int32, int64.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as data.
tf.math.xdivy Returns 0 if x == 0, and x / y otherwise, elementwise.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.xdivy  
tf.math.xdivy(
    x, y, name=None
)

 


 Args
  x   A Tensor. Must be one of the following types: half, float32, float64, complex64, complex128.  
  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.xlog1py Compute x * log1p(y).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.xlog1py  
tf.math.xlog1py(
    x, y, name=None
)
 Given x and y, compute x * log1p(y). This function safely returns zero when x = 0, no matter what the value of y is. Example: 
tf.math.xlog1py(0., 1.)
<tf.Tensor: shape=(), dtype=float32, numpy=0.>
tf.math.xlog1py(1., 1.)
<tf.Tensor: shape=(), dtype=float32, numpy=0.6931472>
tf.math.xlog1py(2., 2.)
<tf.Tensor: shape=(), dtype=float32, numpy=2.1972246>
tf.math.xlog1py(0., -1.)
<tf.Tensor: shape=(), dtype=float32, numpy=0.>

 


 Args
  x   A tf.Tensor of type bfloat16, half, float32, float64, complex64, complex128  
  y   A tf.Tensor of type bfloat16, half, float32, float64, complex64, complex128  
  name   A name for the operation (optional).   
 


 Returns   x * log1p(y).  
 Scipy Compatibility Equivalent to scipy.special.xlog1py
tf.math.xlogy Returns 0 if x == 0, and x * log(y) otherwise, elementwise.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.xlogy  
tf.math.xlogy(
    x, y, name=None
)

 


 Args
  x   A Tensor. Must be one of the following types: half, float32, float64, complex64, complex128.  
  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.zero_fraction     View source on GitHub    Returns the fraction of zeros in value.  View aliases  Main aliases 
tf.nn.zero_fraction Compat aliases for migration See Migration guide for more details. tf.compat.v1.math.zero_fraction, tf.compat.v1.nn.zero_fraction  
tf.math.zero_fraction(
    value, name=None
)
 If value is empty, the result is nan. This is useful in summaries to measure and report sparsity. For example, z = tf.nn.relu(...)
summ = tf.compat.v1.summary.scalar('sparsity', tf.nn.zero_fraction(z))

 


 Args
  value   A tensor of numeric type.  
  name   A name for the operation (optional).   
 


 Returns   The fraction of zeros in value, with type float32.
tf.math.zeta   Compute the Hurwitz zeta function \(\zeta(x, q)\).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.zeta, tf.compat.v1.zeta  
tf.math.zeta(
    x, q, name=None
)
 The Hurwitz zeta function is defined as: \(\zeta(x, q) = \sum_{n=0}^{\infty} (q + n)^{-x}\)
 


 Args
  x   A Tensor. Must be one of the following types: float32, float64.  
  q   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.meshgrid     View source on GitHub    Broadcasts parameters for evaluation on an N-D grid.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.meshgrid  
tf.meshgrid(
    *args, **kwargs
)
 Given N one-dimensional coordinate arrays *args, returns a list outputs of N-D coordinate arrays for evaluating expressions on an N-D grid. Notes: meshgrid supports cartesian ('xy') and matrix ('ij') indexing conventions. When the indexing argument is set to 'xy' (the default), the broadcasting instructions for the first two dimensions are swapped. Examples: Calling X, Y = meshgrid(x, y) with the tensors x = [1, 2, 3]
y = [4, 5, 6]
X, Y = tf.meshgrid(x, y)
# X = [[1, 2, 3],
#      [1, 2, 3],
#      [1, 2, 3]]
# Y = [[4, 4, 4],
#      [5, 5, 5],
#      [6, 6, 6]]

 


 Args
  *args   Tensors with rank 1.  
  **kwargs    indexing: Either 'xy' or 'ij' (optional, default: 'xy'). name: A name for the operation (optional). 

  
 


 Returns
  outputs   A list of N Tensors with rank N.   
 


 Raises
  TypeError   When no keyword arguments (kwargs) are passed.  
  ValueError   When indexing keyword argument is not one of xy or ij.
Module: tf.mixed_precision Public API for tf.mixed_precision namespace. Modules experimental module: Public API for tf.mixed_precision.experimental namespace.
Module: tf.mixed_precision.experimental Public API for tf.mixed_precision.experimental namespace. Classes class DynamicLossScale: Loss scale that dynamically adjusts itself. class FixedLossScale: Loss scale with a fixed value. class LossScale: Base class for all TF1 loss scales.
tf.mixed_precision.experimental.DynamicLossScale Loss scale that dynamically adjusts itself. Inherits From: LossScale  View aliases  Main aliases 
tf.train.experimental.DynamicLossScale Compat aliases for migration See Migration guide for more details. tf.compat.v1.mixed_precision.DynamicLossScale, tf.compat.v1.mixed_precision.experimental.DynamicLossScale, tf.compat.v1.train.experimental.DynamicLossScale  
tf.mixed_precision.experimental.DynamicLossScale(
    initial_loss_scale=(2 ** 15), increment_period=2000, multiplier=2.0
)
 Warning: This class is deprecated and will be unexposed from the TF 2 namespace starting in TensorFlow 2.5. In TensorFlow 2.5, this class will only be accessible as tf.compat.v1.mixed_precision.DynamicLossScale. Additionally in 2.5, you will no longer be able to pass a DynamicLossScale to a tf.keras.mixed_precision.Policy. All the functionality in this class has been merged into tf.keras.mixed_precision.LossScaleOptimizer, so this class is no longer needed. Dynamic loss scaling works by adjusting the loss scale as training progresses. The goal is to keep the loss scale as high as possible without overflowing the gradients. As long as the gradients do not overflow, raising the loss scale never hurts. The algorithm starts by setting the loss scale to an initial value. Every N steps that the gradients are finite, the loss scale is increased by some factor. However, if a NaN or Inf gradient is found, the gradients for that step are not applied, and the loss scale is decreased by the factor. This process tends to keep the loss scale as high as possible without gradients overflowing.
 


 Args
  initial_loss_scale   A Python float. The loss scale to use at the beginning. It's better to start this at a very high number, because a loss scale that is too high gets lowered far more quickly than a loss scale that is too low gets raised. The default is 2 ** 15, which is approximately half the maximum float16 value.  
  increment_period   Increases loss scale every increment_period consecutive steps that finite gradients are encountered. If a nonfinite gradient is encountered, the count is reset back to zero.  
  multiplier   The multiplier to use when increasing or decreasing the loss scale.   
 


 Attributes
  increment_period  
 
  initial_loss_scale  
 
  multiplier  
   Methods from_config View source 
@classmethod
from_config(
    config
)
 Creates the LossScale from its config. get_config View source 
get_config()
 Returns the config of this loss scale. update View source 
update(
    grads
)
 Updates loss scale based on if gradients are finite in current step. __call__ View source 
__call__()
 Returns the current loss scale as a scalar float32 tensor.
Module: tf.mlir Public API for tf.mlir namespace. Modules experimental module: Public API for tf.mlir.experimental namespace.
Module: tf.mlir.experimental Public API for tf.mlir.experimental namespace. Functions convert_function(...): Import a ConcreteFunction and convert it to a textual MLIR module. convert_graph_def(...): Import a GraphDef and convert it to a textual MLIR module.