neulab/docprompting-conala huggingface dataset:
tf.compat.v1.bincount Counts the number of occurrences of each value in an integer array.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.math.bincount  
tf.compat.v1.bincount(
    arr, weights=None, minlength=None, maxlength=None, dtype=tf.dtypes.int32
)
 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.
 


 Args
  arr   An int32 tensor of non-negative values.  
  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.   
 


 Returns   A vector with the same dtype as weights or the given dtype. The bin values.
Module: tf.compat.v1.bitwise Operations for manipulating the binary representations of integers. Functions bitwise_and(...): Elementwise computes the bitwise AND of x and y. bitwise_or(...): Elementwise computes the bitwise OR of x and y. bitwise_xor(...): Elementwise computes the bitwise XOR of x and y. invert(...): Invert (flip) each bit of supported types; for example, type uint8 value 01010101 becomes 10101010. left_shift(...): Elementwise computes the bitwise left-shift of x and y. right_shift(...): Elementwise computes the bitwise right-shift of x and y.
tf.compat.v1.boolean_mask Apply boolean mask to tensor. 
tf.compat.v1.boolean_mask(
    tensor, mask, name='boolean_mask', axis=None
)
 Numpy equivalent is tensor[mask]. In general, 0 < dim(mask) = K <= dim(tensor), and mask's shape must match the first K dimensions of tensor's shape. We then have: boolean_mask(tensor, mask)[i, j1,...,jd] = tensor[i1,...,iK,j1,...,jd] where (i1,...,iK) is the ith True entry of mask (row-major order). The axis could be used with mask to indicate the axis to mask from. In that case, axis + dim(mask) <= dim(tensor) and mask's shape must match the first axis + dim(mask) dimensions of tensor's shape. See also: tf.ragged.boolean_mask, which can be applied to both dense and ragged tensors, and can be used if you need to preserve the masked dimensions of tensor (rather than flattening them, as tf.boolean_mask does). Examples: # 1-D example
tensor = [0, 1, 2, 3]
mask = np.array([True, False, True, False])
tf.boolean_mask(tensor, mask)  # [0, 2]

# 2-D example
tensor = [[1, 2], [3, 4], [5, 6]]
mask = np.array([True, False, True])
tf.boolean_mask(tensor, mask)  # [[1, 2], [5, 6]]

 


 Args
  tensor   N-D Tensor.  
  mask   K-D boolean Tensor, K <= N and K must be known statically.  
  name   A name for this operation (optional).  
  axis   A 0-D int Tensor representing the axis in tensor to mask from. By default, axis is 0 which will mask from the first dimension. Otherwise K + axis <= N.   
 


 Returns   (N-K+1)-dimensional tensor populated by entries in tensor corresponding to True values in mask.  

 


 Raises
  ValueError   If shapes do not conform.
tf.compat.v1.case Create a case operation. 
tf.compat.v1.case(
    pred_fn_pairs, default=None, exclusive=False, strict=False,
    name='case'
)
 See also tf.switch_case. The pred_fn_pairs parameter is a dict or list of pairs of size N. Each pair contains a boolean scalar tensor and a python callable that creates the tensors to be returned if the boolean evaluates to True. default is a callable generating a list of tensors. All the callables in pred_fn_pairs as well as default (if provided) should return the same number and types of tensors. If exclusive==True, all predicates are evaluated, and an exception is thrown if more than one of the predicates evaluates to True. If exclusive==False, execution stops at the first predicate which evaluates to True, and the tensors generated by the corresponding function are returned immediately. If none of the predicates evaluate to True, this operation returns the tensors generated by default. tf.case supports nested structures as implemented in tf.contrib.framework.nest. All of the callables must return the same (possibly nested) value structure of lists, tuples, and/or named tuples. Singleton lists and tuples form the only exceptions to this: when returned by a callable, they are implicitly unpacked to single values. This behavior is disabled by passing strict=True. If an unordered dictionary is used for pred_fn_pairs, the order of the conditional tests is not guaranteed. However, the order is guaranteed to be deterministic, so that variables created in conditional branches are created in fixed order across runs. Example 1: Pseudocode: if (x < y) return 17;
else return 23;
 Expressions: f1 = lambda: tf.constant(17)
f2 = lambda: tf.constant(23)
r = tf.case([(tf.less(x, y), f1)], default=f2)
 Example 2: Pseudocode: if (x < y && x > z) raise OpError("Only one predicate may evaluate to True");
if (x < y) return 17;
else if (x > z) return 23;
else return -1;
 Expressions: def f1(): return tf.constant(17)
def f2(): return tf.constant(23)
def f3(): return tf.constant(-1)
r = tf.case({tf.less(x, y): f1, tf.greater(x, z): f2},
         default=f3, exclusive=True)

 


 Args
  pred_fn_pairs   Dict or list of pairs of a boolean scalar tensor and a callable which returns a list of tensors.  
  default   Optional callable that returns a list of tensors.  
  exclusive   True iff at most one predicate is allowed to evaluate to True.  
  strict   A boolean that enables/disables 'strict' mode; see above.  
  name   A name for this operation (optional).   
 


 Returns   The tensors returned by the first pair whose predicate evaluated to True, or those returned by default if none does.  

 


 Raises
  TypeError   If pred_fn_pairs is not a list/dictionary.  
  TypeError   If pred_fn_pairs is a list but does not contain 2-tuples.  
  TypeError   If fns[i] is not callable for any i, or default is not callable.    Eager Compatibility Unordered dictionaries are not supported in eager mode when exclusive=False. Use a list of tuples instead.
tf.compat.v1.clip_by_average_norm Clips tensor values to a maximum average L2-norm. (deprecated) 
tf.compat.v1.clip_by_average_norm(
    t, clip_norm, name=None
)
 Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: clip_by_average_norm is deprecated in TensorFlow 2.0. Please use clip_by_norm(t, clip_norm * tf.cast(tf.size(t), tf.float32), name) instead. Given a tensor t, and a maximum clip value clip_norm, this operation normalizes t so that its average L2-norm is less than or equal to clip_norm. Specifically, if the average L2-norm is already less than or equal to clip_norm, then t is not modified. If the average L2-norm is greater than clip_norm, then this operation returns a tensor of the same type and shape as t with its values set to: t * clip_norm / l2norm_avg(t) In this case, the average L2-norm of the output tensor is clip_norm. This operation is typically used to clip gradients before applying them with an optimizer.
 


 Args
  t   A Tensor.  
  clip_norm   A 0-D (scalar) Tensor > 0. A maximum clipping value.  
  name   A name for the operation (optional).   
 


 Returns   A clipped Tensor.
tf.compat.v1.colocate_with DEPRECATED FUNCTION 
tf.compat.v1.colocate_with(
    op, ignore_existing=False
)
 Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Colocations handled automatically by placer.
Module: tf.compat.v1.compat Compatibility functions. The tf.compat module contains two sets of compatibility functions. Tensorflow 1.x and 2.x APIs The compat.v1 and compat.v2 submodules provide a complete copy of both the v1 and v2 APIs for backwards and forwards compatibility across TensorFlow versions 1.x and 2.x. See the migration guide for details. Utilities for writing compatible code Aside from the compat.v1 and compat.v2 submodules, tf.compat also contains a set of helper functions for writing code that works in both:  TensorFlow 1.x and 2.x Python 2 and 3  Type collections The compatibility module also provides the following aliases for common sets of python types:  bytes_or_text_types complex_types integral_types real_types  Functions as_bytes(...): Converts bytearray, bytes, or unicode python input types to bytes. as_str(...) as_str_any(...): Converts input to str type. as_text(...): Converts any string-like python input types to unicode. dimension_at_index(...): Compatibility utility required to allow for both V1 and V2 behavior in TF. dimension_value(...): Compatibility utility required to allow for both V1 and V2 behavior in TF. forward_compatibility_horizon(...): Context manager for testing forward compatibility of generated graphs. forward_compatible(...): Return true if the forward compatibility window has expired. path_to_str(...): Converts input which is a PathLike object to str type.
 


 Other Members
  bytes_or_text_types  
 
  complex_types  
 
  integral_types  
 
  real_types
tf.compat.v1.cond Return true_fn() if the predicate pred is true else false_fn(). (deprecated arguments) 
tf.compat.v1.cond(
    pred, true_fn=None, false_fn=None, strict=False, name=None, fn1=None, fn2=None
)
 Warning: SOME ARGUMENTS ARE DEPRECATED: (fn1, fn2). They will be removed in a future version. Instructions for updating: fn1/fn2 are deprecated in favor of the true_fn/false_fn arguments. true_fn and false_fn both return lists of output tensors. true_fn and false_fn must have the same non-zero number and type of outputs. Warning: Any Tensors or Operations created outside of true_fn and false_fn will be executed regardless of which branch is selected at runtime. Although this behavior is consistent with the dataflow model of TensorFlow, it has frequently surprised users who expected a lazier semantics. Consider the following simple program: z = tf.multiply(a, b)
result = tf.cond(x < y, lambda: tf.add(x, z), lambda: tf.square(y))
 If x < y, the tf.add operation will be executed and tf.square operation will not be executed. Since z is needed for at least one branch of the cond, the tf.multiply operation is always executed, unconditionally. Note that cond calls true_fn and false_fn exactly once (inside the call to cond, and not at all during Session.run()). cond stitches together the graph fragments created during the true_fn and false_fn calls with some additional graph nodes to ensure that the right branch gets executed depending on the value of pred. tf.cond supports nested structures as implemented in tensorflow.python.util.nest. Both true_fn and false_fn must return the same (possibly nested) value structure of lists, tuples, and/or named tuples. Singleton lists and tuples form the only exceptions to this: when returned by true_fn and/or false_fn, they are implicitly unpacked to single values. This behavior is disabled by passing strict=True.
 


 Args
  pred   A scalar determining whether to return the result of true_fn or false_fn.  
  true_fn   The callable to be performed if pred is true.  
  false_fn   The callable to be performed if pred is false.  
  strict   A boolean that enables/disables 'strict' mode; see above.  
  name   Optional name prefix for the returned tensors.   
 


 Returns   Tensors returned by the call to either true_fn or false_fn. If the callables return a singleton list, the element is extracted from the list.  

 


 Raises
  TypeError   if true_fn or false_fn is not callable.  
  ValueError   if true_fn and false_fn do not return the same number of tensors, or return tensors of different types.    Example: x = tf.constant(2)
y = tf.constant(5)
def f1(): return tf.multiply(x, 17)
def f2(): return tf.add(y, 23)
r = tf.cond(tf.less(x, y), f1, f2)
# r is set to f1().
# Operations in f2 (e.g., tf.add) are not executed.
tf.compat.v1.ConditionalAccumulator A conditional accumulator for aggregating gradients. Inherits From: ConditionalAccumulatorBase 
tf.compat.v1.ConditionalAccumulator(
    dtype, shape=None, shared_name=None, name='conditional_accumulator',
    reduction_type='MEAN'
)
 Up-to-date gradients (i.e., time step at which gradient was computed is equal to the accumulator's time step) are added to the accumulator. Extraction of the average gradient is blocked until the required number of gradients has been accumulated.
 


 Args
  dtype   Datatype of the accumulated gradients.  
  shape   Shape of the accumulated gradients.  
  shared_name   Optional. If non-empty, this accumulator will be shared under the given name across multiple sessions.  
  name   Optional name for the accumulator.  
  reduction_type   Reduction type to use when taking the gradient.   
 


 Attributes
  accumulator_ref   The underlying accumulator reference.  
  dtype   The datatype of the gradients accumulated by this accumulator.  
  name   The name of the underlying accumulator.    Methods apply_grad View source 
apply_grad(
    grad, local_step=0, name=None
)
 Attempts to apply a gradient to the accumulator. The attempt is silently dropped if the gradient is stale, i.e., local_step is less than the accumulator's global time step.
 


 Args
  grad   The gradient tensor to be applied.  
  local_step   Time step at which the gradient was computed.  
  name   Optional name for the operation.   
 


 Returns   The operation that (conditionally) applies a gradient to the accumulator.  

 


 Raises
  ValueError   If grad is of the wrong shape    num_accumulated View source 
num_accumulated(
    name=None
)
 Number of gradients that have currently been aggregated in accumulator.
 


 Args
  name   Optional name for the operation.   
 


 Returns   Number of accumulated gradients currently in accumulator.  
 set_global_step View source 
set_global_step(
    new_global_step, name=None
)
 Sets the global time step of the accumulator. The operation logs a warning if we attempt to set to a time step that is lower than the accumulator's own time step.
 


 Args
  new_global_step   Value of new time step. Can be a variable or a constant  
  name   Optional name for the operation.   
 


 Returns   Operation that sets the accumulator's time step.  
 take_grad View source 
take_grad(
    num_required, name=None
)
 Attempts to extract the average gradient from the accumulator. The operation blocks until sufficient number of gradients have been successfully applied to the accumulator. Once successful, the following actions are also triggered:  Counter of accumulated gradients is reset to 0. Aggregated gradient is reset to 0 tensor. Accumulator's internal time step is incremented by 1. 
 


 Args
  num_required   Number of gradients that needs to have been aggregated  
  name   Optional name for the operation   
 


 Returns   A tensor holding the value of the average gradient.  

 


 Raises
  InvalidArgumentError   If num_required < 1
tf.compat.v1.ConditionalAccumulatorBase A conditional accumulator for aggregating gradients. 
tf.compat.v1.ConditionalAccumulatorBase(
    dtype, shape, accumulator_ref
)
 Up-to-date gradients (i.e., time step at which gradient was computed is equal to the accumulator's time step) are added to the accumulator. Extraction of the average gradient is blocked until the required number of gradients has been accumulated.
 


 Args
  dtype   Datatype of the accumulated gradients.  
  shape   Shape of the accumulated gradients.  
  accumulator_ref   A handle to the conditional accumulator, created by sub- classes   
 


 Attributes
  accumulator_ref   The underlying accumulator reference.  
  dtype   The datatype of the gradients accumulated by this accumulator.  
  name   The name of the underlying accumulator.    Methods num_accumulated View source 
num_accumulated(
    name=None
)
 Number of gradients that have currently been aggregated in accumulator.
 


 Args
  name   Optional name for the operation.   
 


 Returns   Number of accumulated gradients currently in accumulator.  
 set_global_step View source 
set_global_step(
    new_global_step, name=None
)
 Sets the global time step of the accumulator. The operation logs a warning if we attempt to set to a time step that is lower than the accumulator's own time step.
 


 Args
  new_global_step   Value of new time step. Can be a variable or a constant  
  name   Optional name for the operation.   
 


 Returns   Operation that sets the accumulator's time step.
Module: tf.compat.v1.config Public API for tf.config namespace. Modules experimental module: Public API for tf.config.experimental namespace. optimizer module: Public API for tf.config.optimizer namespace. threading module: Public API for tf.config.threading namespace. Classes class LogicalDevice: Abstraction for a logical device initialized by the runtime. class LogicalDeviceConfiguration: Configuration class for a logical devices. class PhysicalDevice: Abstraction for a locally visible physical device. Functions experimental_connect_to_cluster(...): Connects to the given cluster. experimental_connect_to_host(...): Connects to a single machine to enable remote execution on it. experimental_functions_run_eagerly(...): Returns the value of the experimental_run_functions_eagerly setting. (deprecated) experimental_run_functions_eagerly(...): Enables / disables eager execution of tf.functions. (deprecated) functions_run_eagerly(...): Returns the value of the run_functions_eagerly setting. get_logical_device_configuration(...): Get the virtual device configuration for a tf.config.PhysicalDevice. get_soft_device_placement(...): Get if soft device placement is enabled. get_visible_devices(...): Get the list of visible physical devices. list_logical_devices(...): Return a list of logical devices created by runtime. list_physical_devices(...): Return a list of physical devices visible to the host runtime. run_functions_eagerly(...): Enables / disables eager execution of tf.functions. set_logical_device_configuration(...): Set the logical device configuration for a tf.config.PhysicalDevice. set_soft_device_placement(...): Set if soft device placement is enabled. set_visible_devices(...): Set the list of visible devices.
Module: tf.compat.v1.config.experimental Public API for tf.config.experimental namespace. Classes class ClusterDeviceFilters: Represent a collection of device filters for the remote workers in cluster. class VirtualDeviceConfiguration: Configuration class for a logical devices. Functions disable_mlir_bridge(...): Disables experimental MLIR-Based TensorFlow Compiler Bridge. disable_mlir_graph_optimization(...): Disables experimental MLIR-Based TensorFlow Compiler Optimizations. enable_mlir_bridge(...): Enables experimental MLIR-Based TensorFlow Compiler Bridge. enable_mlir_graph_optimization(...): Enables experimental MLIR-Based TensorFlow Compiler Optimizations. enable_tensor_float_32_execution(...): Enable or disable the use of TensorFloat-32 on supported hardware. get_device_details(...): Returns details about a physical devices. get_device_policy(...): Gets the current device policy. get_memory_growth(...): Get if memory growth is enabled for a PhysicalDevice. get_memory_usage(...): Get the memory usage, in bytes, for the chosen device. get_synchronous_execution(...): Gets whether operations are executed synchronously or asynchronously. get_virtual_device_configuration(...): Get the virtual device configuration for a tf.config.PhysicalDevice. get_visible_devices(...): Get the list of visible physical devices. list_logical_devices(...): Return a list of logical devices created by runtime. list_physical_devices(...): Return a list of physical devices visible to the host runtime. set_device_policy(...): Sets the current thread device policy. set_memory_growth(...): Set if memory growth should be enabled for a PhysicalDevice. set_synchronous_execution(...): Specifies whether operations are executed synchronously or asynchronously. set_virtual_device_configuration(...): Set the logical device configuration for a tf.config.PhysicalDevice. set_visible_devices(...): Set the list of visible devices. tensor_float_32_execution_enabled(...): Returns whether TensorFloat-32 is enabled.
Module: tf.compat.v1.config.optimizer Public API for tf.config.optimizer namespace. Functions get_experimental_options(...): Get experimental optimizer options. get_jit(...): Get if JIT compilation is enabled. set_experimental_options(...): Set experimental optimizer options. set_jit(...): Set if JIT compilation is enabled.
Module: tf.compat.v1.config.threading Public API for tf.config.threading namespace. Functions get_inter_op_parallelism_threads(...): Get number of threads used for parallelism between independent operations. get_intra_op_parallelism_threads(...): Get number of threads used within an individual op for parallelism. set_inter_op_parallelism_threads(...): Set number of threads used for parallelism between independent operations. set_intra_op_parallelism_threads(...): Set number of threads used within an individual op for parallelism.
tf.compat.v1.ConfigProto A ProtocolMessage
 


 Attributes
  allow_soft_placement   bool allow_soft_placement  
  cluster_def   ClusterDef cluster_def  
  device_count   repeated DeviceCountEntry device_count  
  device_filters   repeated string device_filters  
  experimental   Experimental experimental  
  gpu_options   GPUOptions gpu_options  
  graph_options   GraphOptions graph_options  
  inter_op_parallelism_threads   int32 inter_op_parallelism_threads  
  intra_op_parallelism_threads   int32 intra_op_parallelism_threads  
  isolate_session_state   bool isolate_session_state  
  log_device_placement   bool log_device_placement  
  operation_timeout_in_ms   int64 operation_timeout_in_ms  
  placement_period   int32 placement_period  
  rpc_options   RPCOptions rpc_options  
  session_inter_op_thread_pool   repeated ThreadPoolOptionProto session_inter_op_thread_pool  
  share_cluster_devices_in_session   bool share_cluster_devices_in_session  
  use_per_session_threads   bool use_per_session_threads    Child Classes class DeviceCountEntry class Experimental
tf.compat.v1.ConfigProto.DeviceCountEntry A ProtocolMessage
 


 Attributes
  key   string key  
  value   int32 value
tf.compat.v1.ConfigProto.Experimental A ProtocolMessage
 


 Attributes
  collective_deterministic_sequential_execution   bool collective_deterministic_sequential_execution  
  collective_group_leader   string collective_group_leader  
  collective_nccl   bool collective_nccl  
  disable_output_partition_graphs   bool disable_output_partition_graphs  
  disable_thread_spinning   bool disable_thread_spinning  
  enable_mlir_bridge   bool enable_mlir_bridge  
  enable_mlir_graph_optimization   bool enable_mlir_graph_optimization  
  executor_type   string executor_type  
  mlir_bridge_rollout   MlirBridgeRollout mlir_bridge_rollout  
  optimize_for_static_graph   bool optimize_for_static_graph  
  recv_buf_max_chunk   int32 recv_buf_max_chunk  
  session_metadata   SessionMetadata session_metadata  
  share_cluster_devices_in_session   bool share_cluster_devices_in_session  
  share_session_state_in_clusterspec_propagation   bool share_session_state_in_clusterspec_propagation  
  use_numa_affinity   bool use_numa_affinity  
  xla_fusion_autotuner_thresh   int64 xla_fusion_autotuner_thresh   
 


 Class Variables
  MLIR_BRIDGE_ROLLOUT_DISABLED   2  
  MLIR_BRIDGE_ROLLOUT_ENABLED   1  
  MLIR_BRIDGE_ROLLOUT_UNSPECIFIED   0  
  MlirBridgeRollout