neulab/docprompting-conala huggingface dataset:
tf.compat.v1.random_poisson Draws shape samples from each of the given Poisson distribution(s).  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.random.poisson  
tf.compat.v1.random_poisson(
    lam, shape, dtype=tf.dtypes.float32, seed=None, name=None
)
 lam is the rate parameter describing the distribution(s). Example: samples = tf.random.poisson([0.5, 1.5], [10])
# samples has shape [10, 2], where each slice [:, 0] and [:, 1] represents
# the samples drawn from each distribution

samples = tf.random.poisson([12.2, 3.3], [7, 5])
# samples has shape [7, 5, 2], where each slice [:, :, 0] and [:, :, 1]
# represents the 7x5 samples drawn from each of the two distributions

 


 Args
  lam   A Tensor or Python value or N-D array of type dtype. lam provides the rate parameter(s) describing the poisson distribution(s) to sample.  
  shape   A 1-D integer Tensor or Python array. The shape of the output samples to be drawn per "rate"-parameterized distribution.  
  dtype   The type of the output: float16, float32, float64, int32 or int64.  
  seed   A Python integer. Used to create a random seed for the distributions. See tf.random.set_seed for behavior.  
  name   Optional name for the operation.   
 


 Returns
  samples   a Tensor of shape tf.concat([shape, tf.shape(lam)], axis=0) with values of type dtype.
tf.compat.v1.random_uniform_initializer Initializer that generates tensors with a uniform distribution.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.initializers.random_uniform  
tf.compat.v1.random_uniform_initializer(
    minval=0, maxval=None, seed=None, dtype=tf.dtypes.float32
)

 


 Args
  minval   A python scalar or a scalar tensor. Lower bound of the range of random values to generate.  
  maxval   A python scalar or a scalar tensor. Upper bound of the range of random values to generate. Defaults to 1 for float types.  
  seed   A Python integer. Used to create random seeds. See tf.compat.v1.set_random_seed for behavior.  
  dtype   Default data type, used if no dtype argument is provided when calling the initializer.    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=None, partition_info=None
)
 Returns a tensor object initialized as specified by the initializer.
 


 Args
  shape   Shape of the tensor.  
  dtype   Optional dtype of the tensor. If not provided use the initializer dtype.  
  partition_info   Optional information about the possible partitioning of a tensor.
tf.compat.v1.reduce_all Computes the "logical and" of elements across dimensions of a tensor. (deprecated arguments)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.reduce_all  
tf.compat.v1.reduce_all(
    input_tensor, axis=None, keepdims=None, name=None, reduction_indices=None,
    keep_dims=None
)
 Warning: SOME ARGUMENTS ARE DEPRECATED: (keep_dims). They will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead Reduces input_tensor along the dimensions given in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each of the entries in axis, which must be unique. If keepdims is true, the reduced dimensions are retained with length 1. If axis is None, all dimensions are reduced, and a tensor with a single element is returned. For example: x = tf.constant([[True,  True], [False, False]])
tf.reduce_all(x)  # False
tf.reduce_all(x, 0)  # [False, False]
tf.reduce_all(x, 1)  # [True, False]

 


 Args
  input_tensor   The boolean tensor to reduce.  
  axis   The dimensions to reduce. If None (the default), reduces all dimensions. Must be in the range [-rank(input_tensor), rank(input_tensor)).  
  keepdims   If true, retains reduced dimensions with length 1.  
  name   A name for the operation (optional).  
  reduction_indices   The old (deprecated) name for axis.  
  keep_dims   Deprecated alias for keepdims.   
 


 Returns   The reduced tensor.  
 Numpy Compatibility Equivalent to np.all
tf.compat.v1.reduce_any Computes the "logical or" of elements across dimensions of a tensor. (deprecated arguments)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.reduce_any  
tf.compat.v1.reduce_any(
    input_tensor, axis=None, keepdims=None, name=None, reduction_indices=None,
    keep_dims=None
)
 Warning: SOME ARGUMENTS ARE DEPRECATED: (keep_dims). They will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead Reduces input_tensor along the dimensions given in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each of the entries in axis, which must be unique. If keepdims is true, the reduced dimensions are retained with length 1. If axis is None, all dimensions are reduced, and a tensor with a single element is returned. For example: x = tf.constant([[True,  True], [False, False]])
tf.reduce_any(x)  # True
tf.reduce_any(x, 0)  # [True, True]
tf.reduce_any(x, 1)  # [True, False]

 


 Args
  input_tensor   The boolean tensor to reduce.  
  axis   The dimensions to reduce. If None (the default), reduces all dimensions. Must be in the range [-rank(input_tensor), rank(input_tensor)).  
  keepdims   If true, retains reduced dimensions with length 1.  
  name   A name for the operation (optional).  
  reduction_indices   The old (deprecated) name for axis.  
  keep_dims   Deprecated alias for keepdims.   
 


 Returns   The reduced tensor.  
 Numpy Compatibility Equivalent to np.any
tf.compat.v1.reduce_join Joins all strings into a single string, or joins along an axis.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.strings.reduce_join  
tf.compat.v1.reduce_join(
    inputs, axis=None, keep_dims=None, separator='', name=None,
    reduction_indices=None, keepdims=None
)
 
tf.strings.reduce_join([['abc','123'],
                        ['def','456']]).numpy()
b'abc123def456'
tf.strings.reduce_join([['abc','123'],
                        ['def','456']], axis=-1).numpy()
array([b'abc123', b'def456'], dtype=object)
tf.strings.reduce_join([['abc','123'],
                        ['def','456']],
                       axis=-1,
                       separator=" ").numpy()
array([b'abc 123', b'def 456'], dtype=object)

 


 Args
  inputs   A tf.string tensor.  
  axis   Which axis to join along. The default behavior is to join all elements, producing a scalar.  
  keepdims   If true, retains reduced dimensions with length 1.  
  separator   a string added between each string being joined.  
  name   A name for the operation (optional).   
 


 Returns   A tf.string tensor.
tf.compat.v1.reduce_logsumexp Computes log(sum(exp(elements across dimensions of a tensor))). (deprecated arguments)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.reduce_logsumexp  
tf.compat.v1.reduce_logsumexp(
    input_tensor, axis=None, keepdims=None, name=None, reduction_indices=None,
    keep_dims=None
)
 Warning: SOME ARGUMENTS ARE DEPRECATED: (keep_dims). They will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead Reduces input_tensor along the dimensions given in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each of the entries in axis, which must be unique. 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. This function is more numerically stable than log(sum(exp(input))). It avoids overflows caused by taking the exp of large inputs and underflows caused by taking the log of small inputs. For example: x = tf.constant([[0., 0., 0.], [0., 0., 0.]])
tf.reduce_logsumexp(x)  # log(6)
tf.reduce_logsumexp(x, 0)  # [log(2), log(2), log(2)]
tf.reduce_logsumexp(x, 1)  # [log(3), log(3)]
tf.reduce_logsumexp(x, 1, keepdims=True)  # [[log(3)], [log(3)]]
tf.reduce_logsumexp(x, [0, 1])  # log(6)

 


 Args
  input_tensor   The tensor to reduce. Should have numeric type.  
  axis   The dimensions to reduce. If None (the default), reduces all dimensions. Must be in the range [-rank(input_tensor), rank(input_tensor)).  
  keepdims   If true, retains reduced dimensions with length 1.  
  name   A name for the operation (optional).  
  reduction_indices   The old (deprecated) name for axis.  
  keep_dims   Deprecated alias for keepdims.   
 


 Returns   The reduced tensor.
tf.compat.v1.reduce_max Computes the maximum of elements across dimensions of a tensor. (deprecated arguments)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.reduce_max  
tf.compat.v1.reduce_max(
    input_tensor, axis=None, keepdims=None, name=None, reduction_indices=None,
    keep_dims=None
)
 Warning: SOME ARGUMENTS ARE DEPRECATED: (keep_dims). They will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead Reduces input_tensor along the dimensions given in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each of the entries in axis, which must be unique. If keepdims is true, the reduced dimensions are retained with length 1. If axis is None, all dimensions are reduced, and a tensor with a single element is returned.
 


 Args
  input_tensor   The tensor to reduce. Should have real numeric type.  
  axis   The dimensions to reduce. If None (the default), reduces all dimensions. Must be in the range [-rank(input_tensor), rank(input_tensor)).  
  keepdims   If true, retains reduced dimensions with length 1.  
  name   A name for the operation (optional).  
  reduction_indices   The old (deprecated) name for axis.  
  keep_dims   Deprecated alias for keepdims.   
 


 Returns   The reduced tensor.  
 Numpy Compatibility Equivalent to np.max
tf.compat.v1.reduce_mean Computes the mean of elements across dimensions of a tensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.reduce_mean  
tf.compat.v1.reduce_mean(
    input_tensor, axis=None, keepdims=None, name=None, reduction_indices=None,
    keep_dims=None
)
 Reduces input_tensor along the dimensions given in axis by computing the mean of elements across the dimensions in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each the entries in axis, which must be unique. If keepdims is true, the reduced dimensions are retained with length 1. If axis is None, all dimensions are reduced, and a tensor with a single element is returned. For example: 
x = tf.constant([[1., 1.], [2., 2.]])
tf.reduce_mean(x)
<tf.Tensor: shape=(), dtype=float32, numpy=1.5>
tf.reduce_mean(x, 0)
<tf.Tensor: shape=(2,), dtype=float32, numpy=array([1.5, 1.5], dtype=float32)>
tf.reduce_mean(x, 1)
<tf.Tensor: shape=(2,), dtype=float32, numpy=array([1., 2.], dtype=float32)>

 


 Args
  input_tensor   The tensor to reduce. Should have numeric type.  
  axis   The dimensions to reduce. If None (the default), reduces all dimensions. Must be in the range [-rank(input_tensor), rank(input_tensor)).  
  keepdims   If true, retains reduced dimensions with length 1.  
  name   A name for the operation (optional).  
  reduction_indices   The old (deprecated) name for axis.  
  keep_dims   Deprecated alias for keepdims.   
 


 Returns   The reduced tensor.  
 Numpy Compatibility Equivalent to np.mean Please note that np.mean has a dtype parameter that could be used to specify the output type. By default this is dtype=float64. On the other hand, tf.reduce_mean has an aggressive type inference from input_tensor, for example: 
x = tf.constant([1, 0, 1, 0])
tf.reduce_mean(x)
<tf.Tensor: shape=(), dtype=int32, numpy=0>
y = tf.constant([1., 0., 1., 0.])
tf.reduce_mean(y)
<tf.Tensor: shape=(), dtype=float32, numpy=0.5>
tf.compat.v1.reduce_min Computes the minimum of elements across dimensions of a tensor. (deprecated arguments)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.reduce_min  
tf.compat.v1.reduce_min(
    input_tensor, axis=None, keepdims=None, name=None, reduction_indices=None,
    keep_dims=None
)
 Warning: SOME ARGUMENTS ARE DEPRECATED: (keep_dims). They will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead Reduces input_tensor along the dimensions given in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each of the entries in axis, which must be unique. If keepdims is true, the reduced dimensions are retained with length 1. If axis is None, all dimensions are reduced, and a tensor with a single element is returned.
 


 Args
  input_tensor   The tensor to reduce. Should have real numeric type.  
  axis   The dimensions to reduce. If None (the default), reduces all dimensions. Must be in the range [-rank(input_tensor), rank(input_tensor)).  
  keepdims   If true, retains reduced dimensions with length 1.  
  name   A name for the operation (optional).  
  reduction_indices   The old (deprecated) name for axis.  
  keep_dims   Deprecated alias for keepdims.   
 


 Returns   The reduced tensor.  
 Numpy Compatibility Equivalent to np.min
tf.compat.v1.reduce_prod Computes the product of elements across dimensions of a tensor. (deprecated arguments)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.reduce_prod  
tf.compat.v1.reduce_prod(
    input_tensor, axis=None, keepdims=None, name=None, reduction_indices=None,
    keep_dims=None
)
 Warning: SOME ARGUMENTS ARE DEPRECATED: (keep_dims). They will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead Reduces input_tensor along the dimensions given in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each of the entries in axis, which must be unique. If keepdims is true, the reduced dimensions are retained with length 1. If axis is None, all dimensions are reduced, and a tensor with a single element is returned.
 


 Args
  input_tensor   The tensor to reduce. Should have numeric type.  
  axis   The dimensions to reduce. If None (the default), reduces all dimensions. Must be in the range [-rank(input_tensor), rank(input_tensor)).  
  keepdims   If true, retains reduced dimensions with length 1.  
  name   A name for the operation (optional).  
  reduction_indices   The old (deprecated) name for axis.  
  keep_dims   Deprecated alias for keepdims.   
 


 Returns   The reduced tensor.  
 Numpy Compatibility Equivalent to np.prod
tf.compat.v1.reduce_sum Computes the sum of elements across dimensions of a tensor. (deprecated arguments)  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.reduce_sum  
tf.compat.v1.reduce_sum(
    input_tensor, axis=None, keepdims=None, name=None, reduction_indices=None,
    keep_dims=None
)
 Warning: SOME ARGUMENTS ARE DEPRECATED: (keep_dims). They will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead Reduces input_tensor along the dimensions given in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each of the entries in axis, which must be unique. If keepdims is true, the reduced dimensions are retained with length 1. If axis is None, all dimensions are reduced, and a tensor with a single element is returned. For example: x = tf.constant([[1, 1, 1], [1, 1, 1]])
tf.reduce_sum(x)  # 6
tf.reduce_sum(x, 0)  # [2, 2, 2]
tf.reduce_sum(x, 1)  # [3, 3]
tf.reduce_sum(x, 1, keepdims=True)  # [[3], [3]]
tf.reduce_sum(x, [0, 1])  # 6

 


 Args
  input_tensor   The tensor to reduce. Should have numeric type.  
  axis   The dimensions to reduce. If None (the default), reduces all dimensions. Must be in the range [-rank(input_tensor), rank(input_tensor)).  
  keepdims   If true, retains reduced dimensions with length 1.  
  name   A name for the operation (optional).  
  reduction_indices   The old (deprecated) name for axis.  
  keep_dims   Deprecated alias for keepdims.   
 


 Returns   The reduced tensor, of the same dtype as the input_tensor.  
 Numpy Compatibility Equivalent to np.sum apart the fact that numpy upcast uint8 and int32 to int64 while tensorflow returns the same dtype as the input.
tf.compat.v1.report_uninitialized_variables Adds ops to list the names of uninitialized variables. 
tf.compat.v1.report_uninitialized_variables(
    var_list=None, name='report_uninitialized_variables'
)
 When run, it returns a 1-D tensor containing the names of uninitialized variables if there are any, or an empty array if there are none.
 


 Args
  var_list   List of Variable objects to check. Defaults to the value of global_variables() + local_variables()  
  name   Optional name of the Operation.   
 


 Returns   A 1-D tensor containing names of the uninitialized variables, or an empty 1-D tensor if there are no variables or no uninitialized variables.  
 
Note: The output of this function should be used. If it is not, a warning will be logged or an error may be raised. To mark the output as used, call its .mark_used() method.
tf.compat.v1.reset_default_graph Clears the default graph stack and resets the global default graph. 
tf.compat.v1.reset_default_graph()
 
Note: The default graph is a property of the current thread. This function applies only to the current thread. Calling this function while a tf.compat.v1.Session or tf.compat.v1.InteractiveSession is active will result in undefined behavior. Using any previously created tf.Operation or tf.Tensor objects after calling this function will result in undefined behavior. Raises: AssertionError: If this function is called within a nested graph.
Module: tf.compat.v1.resource_loader Resource management library. Functions get_data_files_path(...): Get a direct path to the data files colocated with the script. get_path_to_datafile(...): Get the path to the specified file in the data dependencies. get_root_dir_with_all_resources(...): Get a root directory containing all the data attributes in the build rule. load_resource(...): Load the resource at given path, where path is relative to tensorflow/. readahead_file_path(...): Readahead files not implemented; simply returns given path.
tf.compat.v1.resource_loader.get_data_files_path Get a direct path to the data files colocated with the script. 
tf.compat.v1.resource_loader.get_data_files_path()

 


 Returns   The directory where files specified in data attribute of py_test and py_binary are stored.
tf.compat.v1.resource_loader.get_path_to_datafile Get the path to the specified file in the data dependencies. 
tf.compat.v1.resource_loader.get_path_to_datafile(
    path
)
 The path is relative to tensorflow/
 


 Args
  path   a string resource path relative to tensorflow/   
 


 Returns   The path to the specified file present in the data attribute of py_test or py_binary.  

 


 Raises
  IOError   If the path is not found, or the resource can't be opened.
tf.compat.v1.resource_loader.get_root_dir_with_all_resources Get a root directory containing all the data attributes in the build rule. 
tf.compat.v1.resource_loader.get_root_dir_with_all_resources()

 


 Returns   The path to the specified file present in the data attribute of py_test or py_binary. Falls back to returning the same as get_data_files_path if it fails to detect a bazel runfiles directory.
tf.compat.v1.resource_loader.load_resource Load the resource at given path, where path is relative to tensorflow/. 
tf.compat.v1.resource_loader.load_resource(
    path
)

 


 Args
  path   a string resource path relative to tensorflow/.   
 


 Returns   The contents of that resource.  

 


 Raises
  IOError   If the path is not found, or the resource can't be opened.
tf.compat.v1.resource_loader.readahead_file_path Readahead files not implemented; simply returns given path. 
tf.compat.v1.resource_loader.readahead_file_path(
    path, readahead='128M'
)
tf.compat.v1.resource_variables_enabled Returns True if resource variables are enabled. 
tf.compat.v1.resource_variables_enabled()
 Resource variables are improved versions of TensorFlow variables with a well-defined memory model. Accessing a resource variable reads its value, and all ops which access a specific read value of the variable are guaranteed to see the same value for that tensor. Writes which happen after a read (by having a control or data dependency on the read) are guaranteed not to affect the value of the read tensor, and similarly writes which happen before a read are guaranteed to affect the value. No guarantees are made about unordered read/write pairs. Calling tf.enable_resource_variables() lets you opt-in to this TensorFlow 2.0 feature.
tf.compat.v1.reverse_sequence Reverses variable length slices. (deprecated arguments) (deprecated arguments) 
tf.compat.v1.reverse_sequence(
    input, seq_lengths, seq_axis=None, batch_axis=None, name=None, seq_dim=None,
    batch_dim=None
)
 Warning: SOME ARGUMENTS ARE DEPRECATED: (seq_dim). They will be removed in a future version. Instructions for updating: seq_dim is deprecated, use seq_axis insteadWarning: SOME ARGUMENTS ARE DEPRECATED: (batch_dim). They will be removed in a future version. Instructions for updating: batch_dim is deprecated, use batch_axis instead This op first slices input along the dimension batch_axis, and for each slice i, reverses the first seq_lengths[i] elements along the dimension seq_axis. The elements of seq_lengths must obey seq_lengths[i] <= input.dims[seq_axis], and seq_lengths must be a vector of length input.dims[batch_axis]. The output slice i along dimension batch_axis is then given by input slice i, with the first seq_lengths[i] slices along dimension seq_axis reversed. Example usage: 
seq_lengths = [7, 2, 3, 5]
input = [[1, 2, 3, 4, 5, 0, 0, 0], [1, 2, 0, 0, 0, 0, 0, 0],
         [1, 2, 3, 4, 0, 0, 0, 0], [1, 2, 3, 4, 5, 6, 7, 8]]
output = tf.reverse_sequence(input, seq_lengths, seq_axis=1, batch_axis=0)
output
<tf.Tensor: shape=(4, 8), dtype=int32, numpy=
array([[0, 0, 5, 4, 3, 2, 1, 0],
       [2, 1, 0, 0, 0, 0, 0, 0],
       [3, 2, 1, 4, 0, 0, 0, 0],
       [5, 4, 3, 2, 1, 6, 7, 8]], dtype=int32)>

 


 Args
  input   A Tensor. The input to reverse.  
  seq_lengths   A Tensor. Must be one of the following types: int32, int64. 1-D with length input.dims(batch_axis) and max(seq_lengths) <= input.dims(seq_axis)  
  seq_axis   An int. The dimension which is partially reversed.  
  batch_axis   An optional int. Defaults to 0. The dimension along which reversal is performed.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as input.
tf.compat.v1.RunMetadata A ProtocolMessage
 


 Attributes
  cost_graph   CostGraphDef cost_graph  
  function_graphs   repeated FunctionGraphs function_graphs  
  partition_graphs   repeated GraphDef partition_graphs  
  step_stats   StepStats step_stats    Child Classes class FunctionGraphs
tf.compat.v1.RunMetadata.FunctionGraphs A ProtocolMessage
 


 Attributes
  partition_graphs   repeated GraphDef partition_graphs  
  post_optimization_graph   GraphDef post_optimization_graph  
  pre_optimization_graph   GraphDef pre_optimization_graph