neulab/docprompting-conala huggingface dataset:
tf.random.stateless_poisson Outputs deterministic pseudorandom values from a Poisson distribution.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.random.stateless_poisson  
tf.random.stateless_poisson(
    shape, seed, lam, dtype=tf.dtypes.int32, name=None
)
 The generated values follow a Poisson distribution with specified rate parameter. This is a stateless version of tf.random.poisson: if run twice with the same seeds and shapes, it will produce the same pseudorandom numbers. The output is consistent across multiple runs on the same hardware, but may change between versions of TensorFlow or on non-CPU/GPU hardware. A slight difference exists in the interpretation of the shape parameter between stateless_poisson and poisson: in poisson, the shape is always prepended to the shape of lam; whereas in stateless_poisson the shape of lam must match the trailing dimensions of shape. Example: samples = tf.random.stateless_poisson([10, 2], seed=[12, 34], lam=[5, 15])
# samples has shape [10, 2], where each slice [:, 0] and [:, 1] represents
# the samples drawn from each distribution

samples = tf.random.stateless_poisson([7, 5, 2], seed=[12, 34], lam=[5, 15])
# samples has shape [7, 5, 2], where each slice [:, :, 0] and [:, :, 1]
# represents the 7x5 samples drawn from each of the two distributions

rate = tf.constant([[1.], [3.], [5.]])
samples = tf.random.stateless_poisson([30, 3, 1], seed=[12, 34], lam=rate)
# samples has shape [30, 3, 1], with 30 samples each of 3x1 distributions.

 


 Args
  shape   A 1-D integer Tensor or Python array. The shape of the output tensor.  
  seed   A shape [2] Tensor, the seed to the random number generator. Must have dtype int32 or int64. (When using XLA, only int32 is allowed.)  
  lam   Tensor. The rate parameter "lambda" of the Poisson distribution. Shape must match the rightmost dimensions of shape.  
  dtype   Dtype of the samples (int or float dtypes are permissible, as samples are discrete). Default: int32.  
  name   A name for the operation (optional).   
 


 Returns
  samples   A Tensor of the specified shape filled with random Poisson values. For each i, each samples[..., i] is an independent draw from the Poisson distribution with rate lam[i].
tf.random.stateless_truncated_normal     View source on GitHub    Outputs deterministic pseudorandom values, truncated normally distributed.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.random.stateless_truncated_normal  
tf.random.stateless_truncated_normal(
    shape, seed, mean=0.0, stddev=1.0, dtype=tf.dtypes.float32, name=None
)
 This is a stateless version of tf.random.truncated_normal: if run twice with the same seeds and shapes, it will produce the same pseudorandom numbers. The output is consistent across multiple runs on the same hardware (and between CPU and GPU), but may change between versions of TensorFlow or on non-CPU/GPU hardware. The generated values follow a normal distribution with specified mean and standard deviation, except that values whose magnitude is more than 2 standard deviations from the mean are dropped and re-picked.
 


 Args
  shape   A 1-D integer Tensor or Python array. The shape of the output tensor.  
  seed   A shape [2] Tensor, the seed to the random number generator. Must have dtype int32 or int64. (When using XLA, only int32 is allowed.)  
  mean   A 0-D Tensor or Python value of type dtype. The mean of the truncated normal distribution.  
  stddev   A 0-D Tensor or Python value of type dtype. The standard deviation of the normal distribution, before truncation.  
  dtype   The type of the output.  
  name   A name for the operation (optional).   
 


 Returns   A tensor of the specified shape filled with random truncated normal values.
tf.random.stateless_uniform     View source on GitHub    Outputs deterministic pseudorandom values from a uniform distribution.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.random.stateless_uniform  
tf.random.stateless_uniform(
    shape, seed, minval=0, maxval=None, dtype=tf.dtypes.float32, name=None
)
 This is a stateless version of tf.random.uniform: if run twice with the same seeds and shapes, it will produce the same pseudorandom numbers. The output is consistent across multiple runs on the same hardware (and between CPU and GPU), but may change between versions of TensorFlow or on non-CPU/GPU hardware. The generated values follow a uniform distribution in the range [minval, maxval). The lower bound minval is included in the range, while the upper bound maxval is excluded. For floats, the default range is [0, 1). For ints, at least maxval must be specified explicitly. In the integer case, the random integers are slightly biased unless maxval - minval is an exact power of two. The bias is small for values of maxval - minval significantly smaller than the range of the output (either 2**32 or 2**64). For full-range (i.e. inclusive of both max and min) random integers, pass minval=None and maxval=None with an integer dtype. For an integer dtype either both minval and maxval must be None or neither may be None. For example: ints = tf.random.stateless_uniform(
    [10], seed=(2, 3), minval=None, maxval=None, dtype=tf.int32)

 


 Args
  shape   A 1-D integer Tensor or Python array. The shape of the output tensor.  
  seed   A shape [2] Tensor, the seed to the random number generator. Must have dtype int32 or int64. (When using XLA, only int32 is allowed.)  
  minval   A Tensor or Python value of type dtype, broadcastable with shape (for integer types, broadcasting is not supported, so it needs to be a scalar). The lower bound on the range of random values to generate. Pass None for full-range integers. Defaults to 0.  
  maxval   A Tensor or Python value of type dtype, broadcastable with shape (for integer types, broadcasting is not supported, so it needs to be a scalar). The upper bound on the range of random values to generate. Defaults to 1 if dtype is floating point. Pass None for full-range integers.  
  dtype   The type of the output: float16, float32, float64, int32, or int64. For unbounded uniform ints (minval, maxval both None), uint32 and uint64 may be used.  
  name   A name for the operation (optional).   
 


 Returns   A tensor of the specified shape filled with random uniform values.  

 


 Raises
  ValueError   If dtype is integral and only one of minval or maxval is specified.
tf.random.truncated_normal     View source on GitHub    Outputs random values from a truncated normal distribution.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.random.truncated_normal, tf.compat.v1.truncated_normal  
tf.random.truncated_normal(
    shape, mean=0.0, stddev=1.0, dtype=tf.dtypes.float32, seed=None, name=None
)
 The generated values follow a normal distribution with specified mean and standard deviation, except that values whose magnitude is more than 2 standard deviations from the mean are dropped and re-picked.
 


 Args
  shape   A 1-D integer Tensor or Python array. The shape of the output tensor.  
  mean   A 0-D Tensor or Python value of type dtype. The mean of the truncated normal distribution.  
  stddev   A 0-D Tensor or Python value of type dtype. The standard deviation of the normal distribution, before truncation.  
  dtype   The type of the output.  
  seed   A Python integer. Used to create a random seed for the distribution. See tf.random.set_seed for behavior.  
  name   A name for the operation (optional).   
 


 Returns   A tensor of the specified shape filled with random truncated normal values.
tf.random.uniform     View source on GitHub    Outputs random values from a uniform distribution.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.random.uniform, tf.compat.v1.random_uniform  
tf.random.uniform(
    shape, minval=0, maxval=None, dtype=tf.dtypes.float32, seed=None, name=None
)
 The generated values follow a uniform distribution in the range [minval, maxval). The lower bound minval is included in the range, while the upper bound maxval is excluded. For floats, the default range is [0, 1). For ints, at least maxval must be specified explicitly. In the integer case, the random integers are slightly biased unless maxval - minval is an exact power of two. The bias is small for values of maxval - minval significantly smaller than the range of the output (either 2**32 or 2**64). Examples: 
tf.random.uniform(shape=[2])
<tf.Tensor: shape=(2,), dtype=float32, numpy=array([..., ...], dtype=float32)>
tf.random.uniform(shape=[], minval=-1., maxval=0.)
<tf.Tensor: shape=(), dtype=float32, numpy=-...>
tf.random.uniform(shape=[], minval=5, maxval=10, dtype=tf.int64)
<tf.Tensor: shape=(), dtype=int64, numpy=...>
 The seed argument produces a deterministic sequence of tensors across multiple calls. To repeat that sequence, use tf.random.set_seed: 
tf.random.set_seed(5)
tf.random.uniform(shape=[], maxval=3, dtype=tf.int32, seed=10)
<tf.Tensor: shape=(), dtype=int32, numpy=2>
tf.random.uniform(shape=[], maxval=3, dtype=tf.int32, seed=10)
<tf.Tensor: shape=(), dtype=int32, numpy=0>
tf.random.set_seed(5)
tf.random.uniform(shape=[], maxval=3, dtype=tf.int32, seed=10)
<tf.Tensor: shape=(), dtype=int32, numpy=2>
tf.random.uniform(shape=[], maxval=3, dtype=tf.int32, seed=10)
<tf.Tensor: shape=(), dtype=int32, numpy=0>
 Without tf.random.set_seed but with a seed argument is specified, small changes to function graphs or previously executed operations will change the returned value. See tf.random.set_seed for details.
 


 Args
  shape   A 1-D integer Tensor or Python array. The shape of the output tensor.  
  minval   A Tensor or Python value of type dtype, broadcastable with shape (for integer types, broadcasting is not supported, so it needs to be a scalar). The lower bound on the range of random values to generate (inclusive). Defaults to 0.  
  maxval   A Tensor or Python value of type dtype, broadcastable with shape (for integer types, broadcasting is not supported, so it needs to be a scalar). The upper bound on the range of random values to generate (exclusive). Defaults to 1 if dtype is floating point.  
  dtype   The type of the output: float16, float32, float64, int32, or int64.  
  seed   A Python integer. Used in combination with tf.random.set_seed to create a reproducible sequence of tensors across multiple calls.  
  name   A name for the operation (optional).   
 


 Returns   A tensor of the specified shape filled with random uniform values.  

 


 Raises
  ValueError   If dtype is integral and maxval is not specified.
tf.random.uniform_candidate_sampler     View source on GitHub    Samples a set of classes using a uniform base distribution.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.nn.uniform_candidate_sampler, tf.compat.v1.random.uniform_candidate_sampler  
tf.random.uniform_candidate_sampler(
    true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None
)
 This operation randomly samples a tensor of sampled classes (sampled_candidates) from the range of integers [0, range_max). The elements of sampled_candidates are drawn without replacement (if unique=True) or with replacement (if unique=False) from the base distribution. The base distribution for this operation is the uniform distribution over the range of integers [0, range_max). In addition, this operation returns tensors true_expected_count and sampled_expected_count representing the number of times each of the target classes (true_classes) and the sampled classes (sampled_candidates) is expected to occur in an average tensor of sampled classes. These values correspond to Q(y|x) defined in this document. If unique=True, then these are post-rejection probabilities and we compute them approximately.
 


 Args
  true_classes   A Tensor of type int64 and shape [batch_size, num_true]. The target classes.  
  num_true   An int. The number of target classes per training example.  
  num_sampled   An int. The number of classes to randomly sample. The sampled_candidates return value will have shape [num_sampled]. If unique=True, num_sampled must be less than or equal to range_max.  
  unique   A bool. Determines whether all sampled classes in a batch are unique.  
  range_max   An int. The number of possible classes.  
  seed   An int. An operation-specific seed. Default is 0.  
  name   A name for the operation (optional).   
 


 Returns
  sampled_candidates   A tensor of type int64 and shape [num_sampled]. The sampled classes, either with possible duplicates (unique=False) or all unique (unique=True). In either case, sampled_candidates is independent of the true classes.  
  true_expected_count   A tensor of type float. Same shape as true_classes. The expected counts under the sampling distribution of each of true_classes.  
  sampled_expected_count   A tensor of type float. Same shape as sampled_candidates. The expected counts under the sampling distribution of each of sampled_candidates.
tf.random_normal_initializer     View source on GitHub    Initializer that generates tensors with a normal distribution. 
tf.random_normal_initializer(
    mean=0.0, stddev=0.05, seed=None
)
 Initializers allow you to pre-specify an initialization strategy, encoded in the Initializer object, without knowing the shape and dtype of the variable being initialized. Examples: 
def make_variables(k, initializer):
  return (tf.Variable(initializer(shape=[k], dtype=tf.float32)),
          tf.Variable(initializer(shape=[k, k], dtype=tf.float32)))
v1, v2 = make_variables(3,
                        tf.random_normal_initializer(mean=1., stddev=2.))
v1
<tf.Variable ... shape=(3,) ... numpy=array([...], dtype=float32)>
v2
<tf.Variable ... shape=(3, 3) ... numpy=

make_variables(4, tf.random_uniform_initializer(minval=-1., maxval=1.))
(<tf.Variable...shape=(4,) dtype=float32...>, <tf.Variable...shape=(4, 4) ...

 


 Args
  mean   a python scalar or a scalar tensor. Mean of the random values to generate.  
  stddev   a python scalar or a scalar tensor. Standard deviation of the random values to generate.  
  seed   A Python integer. Used to create random seeds. See tf.random.set_seed for behavior.    Methods from_config View source 
@classmethod
from_config(
    config
)
 Instantiates an initializer from a configuration dictionary. Example: initializer = RandomUniform(-1, 1)
config = initializer.get_config()
initializer = RandomUniform.from_config(config)

 


 Args
  config   A Python dictionary. It will typically be the output of get_config.   
 


 Returns   An Initializer instance.  
 get_config View source 
get_config()
 Returns the configuration of the initializer as a JSON-serializable dict.
 


 Returns   A JSON-serializable Python dict.  
 __call__ View source 
__call__(
    shape, dtype=tf.dtypes.float32, **kwargs
)
 Returns a tensor object initialized as specified by the initializer.
 


 Args
  shape   Shape of the tensor.  
  dtype   Optional dtype of the tensor. Only floating point types are supported.  
  **kwargs   Additional keyword arguments.   
 


 Raises
  ValueError   If the dtype is not floating point
tf.random_uniform_initializer     View source on GitHub    Initializer that generates tensors with a uniform distribution. 
tf.random_uniform_initializer(
    minval=-0.05, maxval=0.05, seed=None
)
 Initializers allow you to pre-specify an initialization strategy, encoded in the Initializer object, without knowing the shape and dtype of the variable being initialized. Examples: 
def make_variables(k, initializer):
  return (tf.Variable(initializer(shape=[k], dtype=tf.float32)),
          tf.Variable(initializer(shape=[k, k], dtype=tf.float32)))
v1, v2 = make_variables(3, tf.ones_initializer())
v1
<tf.Variable ... shape=(3,) ... numpy=array([1., 1., 1.], dtype=float32)>
v2
<tf.Variable ... shape=(3, 3) ... numpy=
array([[1., 1., 1.],
       [1., 1., 1.],
       [1., 1., 1.]], dtype=float32)>
make_variables(4, tf.random_uniform_initializer(minval=-1., maxval=1.))
(<tf.Variable...shape=(4,) dtype=float32...>, <tf.Variable...shape=(4, 4) ...

 


 Args
  minval   A python scalar or a scalar tensor. Lower bound of the range of random values to generate (inclusive).  
  maxval   A python scalar or a scalar tensor. Upper bound of the range of random values to generate (exclusive).  
  seed   A Python integer. Used to create random seeds. See tf.random.set_seed for behavior.    Methods from_config View source 
@classmethod
from_config(
    config
)
 Instantiates an initializer from a configuration dictionary. Example: initializer = RandomUniform(-1, 1)
config = initializer.get_config()
initializer = RandomUniform.from_config(config)

 


 Args
  config   A Python dictionary. It will typically be the output of get_config.   
 


 Returns   An Initializer instance.  
 get_config View source 
get_config()
 Returns the configuration of the initializer as a JSON-serializable dict.
 


 Returns   A JSON-serializable Python dict.  
 __call__ View source 
__call__(
    shape, dtype=tf.dtypes.float32, **kwargs
)
 Returns a tensor object initialized as specified by the initializer.
 


 Args
  shape   Shape of the tensor.  
  dtype   Optional dtype of the tensor. Only floating point and integer types are supported.  
  **kwargs   Additional keyword arguments.   
 


 Raises
  ValueError   If the dtype is not numeric.
tf.range     View source on GitHub    Creates a sequence of numbers.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.range  tf.range(limit, delta=1, dtype=None, name='range')
tf.range(start, limit, delta=1, dtype=None, name='range')
 Creates a sequence of numbers that begins at start and extends by increments of delta up to but not including limit. The dtype of the resulting tensor is inferred from the inputs unless it is provided explicitly. Like the Python builtin range, start defaults to 0, so that range(n) = range(0, n). For example: 
start = 3
limit = 18
delta = 3
tf.range(start, limit, delta)
<tf.Tensor: shape=(5,), dtype=int32,
numpy=array([ 3,  6,  9, 12, 15], dtype=int32)>
 
start = 3
limit = 1
delta = -0.5
tf.range(start, limit, delta)
<tf.Tensor: shape=(4,), dtype=float32,
numpy=array([3. , 2.5, 2. , 1.5], dtype=float32)>
 
limit = 5
tf.range(limit)
<tf.Tensor: shape=(5,), dtype=int32,
numpy=array([0, 1, 2, 3, 4], dtype=int32)>

 


 Args
  start   A 0-D Tensor (scalar). Acts as first entry in the range if limit is not None; otherwise, acts as range limit and first entry defaults to 0.  
  limit   A 0-D Tensor (scalar). Upper limit of sequence, exclusive. If None, defaults to the value of start while the first entry of the range defaults to 0.  
  delta   A 0-D Tensor (scalar). Number that increments start. Defaults to 1.  
  dtype   The type of the elements of the resulting tensor.  
  name   A name for the operation. Defaults to "range".   
 


 Returns   An 1-D Tensor of type dtype.  
 Numpy Compatibility Equivalent to np.arange
tf.rank     View source on GitHub    Returns the rank of a tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.rank  
tf.rank(
    input, name=None
)
 See also tf.shape. Returns a 0-D int32 Tensor representing the rank of input. For example: # shape of tensor 't' is [2, 2, 3]
t = tf.constant([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]])
tf.rank(t)  # 3


Note: The rank of a tensor is not the same as the rank of a matrix. The rank of a tensor is the number of indices required to uniquely select each element of the tensor. Rank is also known as "order", "degree", or "ndims."

 


 Args
  input   A Tensor or SparseTensor.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type int32.  
 Numpy Compatibility Equivalent to np.ndim
tf.raw_ops.Abort Raise a exception to abort the process when called.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.Abort  
tf.raw_ops.Abort(
    error_msg='', exit_without_error=False, name=None
)
 If exit_without_error is true, the process will exit normally, otherwise it will exit with a SIGABORT signal. Returns nothing but an exception.
 


 Args
  error_msg   An optional string. Defaults to "". A string which is the message associated with the exception.  
  exit_without_error   An optional bool. Defaults to False.  
  name   A name for the operation (optional).   
 


 Returns   The created Operation.
tf.raw_ops.Abs   Computes the absolute value of a tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.Abs  
tf.raw_ops.Abs(
    x, name=None
)
 Given a tensor x, this operation returns a tensor containing the absolute value of each element in x. For example, if x is an input element and y is an output element, this operation computes \(y = |x|\).
 


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


 Returns   A Tensor. Has the same type as x.
tf.raw_ops.AccumulateNV2 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.raw_ops.AccumulateNV2  
tf.raw_ops.AccumulateNV2(
    inputs, shape, name=None
)
 tf.accumulate_n_v2 performs the same operation as tf.add_n, but does not wait for all of its inputs to be ready before beginning to sum. This can save memory if inputs are ready at different times, since minimum temporary storage is proportional to the output size rather than the inputs size. Unlike the original accumulate_n, accumulate_n_v2 is differentiable. Returns a Tensor of same shape and type as the elements of inputs.
 


 Args
  inputs   A list of at least 1 Tensor objects with the same type in: float32, float64, int32, uint8, int16, int8, complex64, int64, qint8, quint8, qint32, bfloat16, uint16, complex128, half, uint32, uint64. A list of Tensor objects, each with same shape and type.  
  shape   A tf.TensorShape or list of ints. Shape of elements of inputs.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as inputs.
tf.raw_ops.AccumulatorApplyGradient Applies a gradient to a given accumulator.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.AccumulatorApplyGradient  
tf.raw_ops.AccumulatorApplyGradient(
    handle, local_step, gradient, name=None
)
 Does not add if local_step is lesser than the accumulator's global_step.
 


 Args
  handle   A Tensor of type mutable string. The handle to a accumulator.  
  local_step   A Tensor of type int64. The local_step value at which the gradient was computed.  
  gradient   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. A tensor of the gradient to be accumulated.  
  name   A name for the operation (optional).   
 


 Returns   The created Operation.
tf.raw_ops.AccumulatorNumAccumulated Returns the number of gradients aggregated in the given accumulators.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.AccumulatorNumAccumulated  
tf.raw_ops.AccumulatorNumAccumulated(
    handle, name=None
)

 


 Args
  handle   A Tensor of type mutable string. The handle to an accumulator.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor of type int32.
tf.raw_ops.AccumulatorSetGlobalStep Updates the accumulator with a new value for global_step.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.AccumulatorSetGlobalStep  
tf.raw_ops.AccumulatorSetGlobalStep(
    handle, new_global_step, name=None
)
 Logs warning if the accumulator's value is already higher than new_global_step.
 


 Args
  handle   A Tensor of type mutable string. The handle to an accumulator.  
  new_global_step   A Tensor of type int64. The new global_step value to set.  
  name   A name for the operation (optional).   
 


 Returns   The created Operation.