neulab/docprompting-conala huggingface dataset:
tf.compat.v1.nn.crelu Computes Concatenated ReLU. 
tf.compat.v1.nn.crelu(
    features, name=None, axis=-1
)
 Concatenates a ReLU which selects only the positive part of the activation with a ReLU which selects only the negative part of the activation. Note that as a result this non-linearity doubles the depth of the activations. Source: Understanding and Improving Convolutional Neural Networks via Concatenated Rectified Linear Units. W. Shang, et al.
 


 Args
  features   A Tensor with type float, double, int32, int64, uint8, int16, or int8.  
  name   A name for the operation (optional).  
  axis   The axis that the output values are concatenated along. Default is -1.   
 


 Returns   A Tensor with the same type as features.  
 References: Understanding and Improving Convolutional Neural Networks via Concatenated Rectified Linear Units: Shang et al., 2016 (pdf)
tf.compat.v1.nn.ctc_beam_search_decoder Performs beam search decoding on the logits given in input. 
tf.compat.v1.nn.ctc_beam_search_decoder(
    inputs, sequence_length, beam_width=100, top_paths=1, merge_repeated=True
)
 
Note: The ctc_greedy_decoder is a special case of the ctc_beam_search_decoder with top_paths=1 and beam_width=1 (but that decoder is faster for this special case).
 If merge_repeated is True, merge repeated classes in the output beams. This means that if consecutive entries in a beam are the same, only the first of these is emitted. That is, when the sequence is A B B * B * B (where '*' is the blank label), the return value is:  
A B if merge_repeated = True. 
A B B B if merge_repeated = False. 
 


 Args
  inputs   3-D float Tensor, size [max_time x batch_size x num_classes]. The logits.  
  sequence_length   1-D int32 vector containing sequence lengths, having size [batch_size].  
  beam_width   An int scalar >= 0 (beam search beam width).  
  top_paths   An int scalar >= 0, <= beam_width (controls output size).  
  merge_repeated   Boolean. Default: True.   
 


 Returns   A tuple (decoded, log_probabilities) where     decoded   A list of length top_paths, where decoded[j] is a SparseTensor containing the decoded outputs: decoded[j].indices: Indices matrix (total_decoded_outputs[j] x 2) The rows store: [batch, time]. decoded[j].values: Values vector, size (total_decoded_outputs[j]). The vector stores the decoded classes for beam j. decoded[j].dense_shape: Shape vector, size (2). The shape values are: [batch_size, max_decoded_length[j]]. 
 
  log_probability   A float matrix (batch_size x top_paths) containing sequence log-probabilities.
tf.compat.v1.nn.ctc_loss_v2 Computes CTC (Connectionist Temporal Classification) loss. 
tf.compat.v1.nn.ctc_loss_v2(
    labels, logits, label_length, logit_length, logits_time_major=True, unique=None,
    blank_index=None, name=None
)
 This op implements the CTC loss as presented in (Graves et al., 2006). Notes:  Same as the "Classic CTC" in TensorFlow 1.x's tf.compat.v1.nn.ctc_loss setting of preprocess_collapse_repeated=False, ctc_merge_repeated=True Labels may be supplied as either a dense, zero-padded tensor with a vector of label sequence lengths OR as a SparseTensor. On TPU and GPU: Only dense padded labels are supported. On CPU: Caller may use SparseTensor or dense padded labels but calling with a SparseTensor will be significantly faster. Default blank label is 0 rather num_classes - 1, unless overridden by blank_index. 
 


 Args
  labels   tensor of shape [batch_size, max_label_seq_length] or SparseTensor  
  logits   tensor of shape [frames, batch_size, num_labels], if logits_time_major == False, shape is [batch_size, frames, num_labels].  
  label_length   tensor of shape [batch_size], None if labels is SparseTensor Length of reference label sequence in labels.  
  logit_length   tensor of shape [batch_size] Length of input sequence in logits.  
  logits_time_major   (optional) If True (default), logits is shaped [time, batch, logits]. If False, shape is [batch, time, logits]  
  unique   (optional) Unique label indices as computed by ctc_unique_labels(labels). If supplied, enable a faster, memory efficient implementation on TPU.  
  blank_index   (optional) Set the class index to use for the blank label. Negative values will start from num_classes, ie, -1 will reproduce the ctc_loss behavior of using num_classes - 1 for the blank symbol. There is some memory/performance overhead to switching from the default of 0 as an additional shifted copy of the logits may be created.  
  name   A name for this Op. Defaults to "ctc_loss_dense".   
 


 Returns
  loss   tensor of shape [batch_size], negative log probabilities.    References: Connectionist Temporal Classification - Labeling Unsegmented Sequence Data with Recurrent Neural Networks: Graves et al., 2006 (pdf)
tf.compat.v1.nn.depthwise_conv2d_native Computes a 2-D depthwise convolution. 
tf.compat.v1.nn.depthwise_conv2d_native(
    input, filter, strides, padding, data_format='NHWC', dilations=[1, 1,
    1, 1], name=None
)
 Given an input tensor of shape [batch, in_height, in_width, in_channels] and a filter / kernel tensor of shape [filter_height, filter_width, in_channels, channel_multiplier], containing in_channels convolutional filters of depth 1, depthwise_conv2d applies a different filter to each input channel (expanding from 1 channel to channel_multiplier channels for each), then concatenates the results together. Thus, the output has in_channels * channel_multiplier channels. for k in 0..in_channels-1
  for q in 0..channel_multiplier-1
    output[b, i, j, k * channel_multiplier + q] =
      sum_{di, dj} input[b, strides[1] * i + di, strides[2] * j + dj, k] *
                        filter[di, dj, k, q]
 Must have strides[0] = strides[3] = 1. For the most common case of the same horizontal and vertices strides, strides = [1, stride, stride, 1].
 


 Args
  input   A Tensor. Must be one of the following types: half, bfloat16, float32, float64.  
  filter   A Tensor. Must have the same type as input.  
  strides   A list of ints. 1-D of length 4. The stride of the sliding window for each dimension of input.  
  padding   Controls how to pad the image before applying the convolution. Can be the string "SAME" or "VALID" indicating the type of padding algorithm to use, or a list indicating the explicit paddings at the start and end of each dimension. When explicit padding is used and data_format is "NHWC", this should be in the form [[0, 0], [pad_top, pad_bottom], [pad_left, pad_right], [0, 0]]. When explicit padding used and data_format is "NCHW", this should be in the form [[0, 0], [0, 0], [pad_top, pad_bottom], [pad_left, pad_right]].  
  data_format   An optional string from: "NHWC", "NCHW". Defaults to "NHWC". Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, height, width, channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, channels, height, width].  
  dilations   An optional list of ints. Defaults to [1, 1, 1, 1]. 1-D tensor of length 4. The dilation factor for each dimension of input. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of data_format, see above for details. Dilations in the batch and depth dimensions must be 1.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as input.
tf.compat.v1.nn.dilation2d Computes the grayscale dilation of 4-D input and 3-D filter tensors. 
tf.compat.v1.nn.dilation2d(
    input, filter=None, strides=None, rates=None, padding=None, name=None,
    filters=None, dilations=None
)
 The input tensor has shape [batch, in_height, in_width, depth] and the filter tensor has shape [filter_height, filter_width, depth], i.e., each input channel is processed independently of the others with its own structuring function. The output tensor has shape [batch, out_height, out_width, depth]. The spatial dimensions of the output tensor depend on the padding algorithm. We currently only support the default "NHWC" data_format. In detail, the grayscale morphological 2-D dilation is the max-sum correlation (for consistency with conv2d, we use unmirrored filters): output[b, y, x, c] =
   max_{dy, dx} input[b,
                      strides[1] * y + rates[1] * dy,
                      strides[2] * x + rates[2] * dx,
                      c] +
                filter[dy, dx, c]
 Max-pooling is a special case when the filter has size equal to the pooling kernel size and contains all zeros. Note on duality: The dilation of input by the filter is equal to the negation of the erosion of -input by the reflected filter.
 


 Args
  input   A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. 4-D with shape [batch, in_height, in_width, depth].  
  filter   A Tensor. Must have the same type as input. 3-D with shape [filter_height, filter_width, depth].  
  strides   A list of ints that has length >= 4. The stride of the sliding window for each dimension of the input tensor. Must be: [1, stride_height, stride_width, 1].  
  rates   A list of ints that has length >= 4. The input stride for atrous morphological dilation. Must be: [1, rate_height, rate_width, 1].  
  padding   A string from: "SAME", "VALID". The type of padding algorithm to use.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as input.
tf.compat.v1.nn.dropout Computes dropout. (deprecated arguments) 
tf.compat.v1.nn.dropout(
    x, keep_prob=None, noise_shape=None, seed=None, name=None, rate=None
)
 Warning: SOME ARGUMENTS ARE DEPRECATED: (keep_prob). They will be removed in a future version. Instructions for updating: Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob. For each element of x, with probability rate, outputs 0, and otherwise scales up the input by 1 / (1-rate). The scaling is such that the expected sum is unchanged. By default, each element is kept or dropped independently. If noise_shape is specified, it must be broadcastable to the shape of x, and only dimensions with noise_shape[i] == shape(x)[i] will make independent decisions. For example, if shape(x) = [k, l, m, n] and noise_shape = [k, 1, 1, n], each batch and channel component will be kept independently and each row and column will be kept or not kept together.
 


 Args
  x   A floating point tensor.  
  keep_prob   (deprecated) A deprecated alias for (1-rate).  
  noise_shape   A 1-D Tensor of type int32, representing the shape for randomly generated keep/drop flags.  
  seed   A Python integer. Used to create random seeds. See tf.random.set_seed for behavior.  
  name   A name for this operation (optional).  
  rate   A scalar Tensor with the same type as x. The probability that each element of x is discarded.   
 


 Returns   A Tensor of the same shape of x.  

 


 Raises
  ValueError   If rate is not in [0, 1) or if x is not a floating point tensor.
tf.compat.v1.nn.embedding_lookup Looks up embeddings for the given ids from a list of tensors. 
tf.compat.v1.nn.embedding_lookup(
    params, ids, partition_strategy='mod', name=None,
    validate_indices=True, max_norm=None
)
 This function is used to perform parallel lookups on the list of tensors in params. It is a generalization of tf.gather, where params is interpreted as a partitioning of a large embedding tensor. params may be a PartitionedVariable as returned by using tf.compat.v1.get_variable() with a partitioner. If len(params) > 1, each element id of ids is partitioned between the elements of params according to the partition_strategy. In all strategies, if the id space does not evenly divide the number of partitions, each of the first (max_id + 1) % len(params) partitions will be assigned one more id. If partition_strategy is "mod", we assign each id to partition p = id % len(params). For instance, 13 ids are split across 5 partitions as: [[0, 5, 10], [1, 6, 11], [2, 7, 12], [3, 8], [4, 9]] If partition_strategy is "div", we assign ids to partitions in a contiguous manner. In this case, 13 ids are split across 5 partitions as: [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10], [11, 12]] If the input ids are ragged tensors, partition variables are not supported and the partition strategy and the max_norm are ignored. The results of the lookup are concatenated into a dense tensor. The returned tensor has shape shape(ids) + shape(params)[1:].
 


 Args
  params   A single tensor representing the complete embedding tensor, or a list of P tensors all of same shape except for the first dimension, representing sharded embedding tensors. Alternatively, a PartitionedVariable, created by partitioning along dimension 0. Each element must be appropriately sized for the given partition_strategy.  
  ids   A Tensor or a 'RaggedTensor' with type int32 or int64 containing the ids to be looked up in params.  
  partition_strategy   A string specifying the partitioning strategy, relevant if len(params) > 1. Currently "div" and "mod" are supported. Default is "mod".  
  name   A name for the operation (optional).  
  validate_indices   DEPRECATED. If this operation is assigned to CPU, values in indices are always validated to be within range. If assigned to GPU, out-of-bound indices result in safe but unspecified behavior, which may include raising an error.  
  max_norm   If not None, each embedding is clipped if its l2-norm is larger than this value.   
 


 Returns   A Tensor or a 'RaggedTensor', depending on the input, with the same type as the tensors in params.  

 


 Raises
  ValueError   If params is empty.
tf.compat.v1.nn.embedding_lookup_sparse Looks up embeddings for the given ids and weights from a list of tensors. 
tf.compat.v1.nn.embedding_lookup_sparse(
    params, sp_ids, sp_weights, partition_strategy='mod', name=None,
    combiner=None, max_norm=None
)
 This op assumes that there is at least one id for each row in the dense tensor represented by sp_ids (i.e. there are no rows with empty features), and that all the indices of sp_ids are in canonical row-major order. sp_ids and sp_weights (if not None) are SparseTensors with rank of 2. Embeddings are always aggregated along the last dimension. It also assumes that all id values lie in the range [0, p0), where p0 is the sum of the size of params along dimension 0.
 


 Args
  params   A single tensor representing the complete embedding tensor, or a list tensors all of same shape except for the first dimension, representing sharded embedding tensors. Alternatively, a PartitionedVariable, created by partitioning along dimension 0. Each element must be appropriately sized for the given partition_strategy.  
  sp_ids   N x M SparseTensor of int64 ids where N is typically batch size and M is arbitrary.  
  sp_weights   either a SparseTensor of float / double weights, or None to indicate all weights should be taken to be 1. If specified, sp_weights must have exactly the same shape and indices as sp_ids.  
  partition_strategy   A string specifying the partitioning strategy, relevant if len(params) > 1. Currently "div" and "mod" are supported. Default is "mod". See tf.nn.embedding_lookup for more details.  
  name   Optional name for the op.  
  combiner   A string specifying the reduction op. Currently "mean", "sqrtn" and "sum" are supported. "sum" computes the weighted sum of the embedding results for each row. "mean" is the weighted sum divided by the total weight. "sqrtn" is the weighted sum divided by the square root of the sum of the squares of the weights. Defaults to mean.  
  max_norm   If not None, each embedding is clipped if its l2-norm is larger than this value, before combining.   
 


 Returns   A dense tensor representing the combined embeddings for the sparse ids. For each row in the dense tensor represented by sp_ids, the op looks up the embeddings for all ids in that row, multiplies them by the corresponding weight, and combines these embeddings as specified. In other words, if shape(combined params) = [p0, p1, ..., pm] and shape(sp_ids) = shape(sp_weights) = [d0, d1] then shape(output) = [d0, p1, ..., pm]. For instance, if params is a 10x20 matrix, and sp_ids / sp_weights are [0, 0]: id 1, weight 2.0
[0, 1]: id 3, weight 0.5
[1, 0]: id 0, weight 1.0
[2, 3]: id 1, weight 3.0
 with combiner="mean", then the output will be a 3x20 matrix where output[0, :] = (params[1, :] * 2.0 + params[3, :] * 0.5) / (2.0 + 0.5)
output[1, :] = (params[0, :] * 1.0) / 1.0
output[2, :] = (params[1, :] * 3.0) / 3.0

 

 


 Raises
  TypeError   If sp_ids is not a SparseTensor, or if sp_weights is neither None nor SparseTensor.  
  ValueError   If combiner is not one of {"mean", "sqrtn", "sum"}.
tf.compat.v1.nn.erosion2d Computes the grayscale erosion of 4-D value and 3-D kernel tensors. 
tf.compat.v1.nn.erosion2d(
    value, kernel, strides, rates, padding, name=None
)
 The value tensor has shape [batch, in_height, in_width, depth] and the kernel tensor has shape [kernel_height, kernel_width, depth], i.e., each input channel is processed independently of the others with its own structuring function. The output tensor has shape [batch, out_height, out_width, depth]. The spatial dimensions of the output tensor depend on the padding algorithm. We currently only support the default "NHWC" data_format. In detail, the grayscale morphological 2-D erosion is given by: output[b, y, x, c] =
   min_{dy, dx} value[b,
                      strides[1] * y - rates[1] * dy,
                      strides[2] * x - rates[2] * dx,
                      c] -
                kernel[dy, dx, c]
 Duality: The erosion of value by the kernel is equal to the negation of the dilation of -value by the reflected kernel.
 


 Args
  value   A Tensor. 4-D with shape [batch, in_height, in_width, depth].  
  kernel   A Tensor. Must have the same type as value. 3-D with shape [kernel_height, kernel_width, depth].  
  strides   A list of ints that has length >= 4. 1-D of length 4. The stride of the sliding window for each dimension of the input tensor. Must be: [1, stride_height, stride_width, 1].  
  rates   A list of ints that has length >= 4. 1-D of length 4. The input stride for atrous morphological dilation. Must be: [1, rate_height, rate_width, 1].  
  padding   A string from: "SAME", "VALID". The type of padding algorithm to use.  
  name   A name for the operation (optional). If not specified "erosion2d" is used.   
 


 Returns   A Tensor. Has the same type as value. 4-D with shape [batch, out_height, out_width, depth].  

 


 Raises
  ValueError   If the value depth does not match kernel' shape, or if padding is other than 'VALID' or 'SAME'.
tf.compat.v1.nn.fractional_avg_pool Performs fractional average pooling on the input. (deprecated) 
tf.compat.v1.nn.fractional_avg_pool(
    value, pooling_ratio, pseudo_random=False, overlapping=False,
    deterministic=False, seed=0, seed2=0, name=None
)
 Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: seed2 and deterministic args are deprecated. Use fractional_avg_pool_v2. This is a deprecated version of fractional_avg_pool. Fractional average pooling is similar to Fractional max pooling in the pooling region generation step. The only difference is that after pooling regions are generated, a mean operation is performed instead of a max operation in each pooling region.
 


 Args
  value   A Tensor. 4-D with shape [batch, height, width, channels].  
  pooling_ratio   A list of floats that has length >= 4. Pooling ratio for each dimension of value, currently only supports row and col dimension and should be >= 1.0. For example, a valid pooling ratio looks like [1.0, 1.44, 1.73, 1.0]. The first and last elements must be 1.0 because we don't allow pooling on batch and channels dimensions. 1.44 and 1.73 are pooling ratio on height and width dimensions respectively.  
  pseudo_random   An optional bool. Defaults to False. When set to True, generates the pooling sequence in a pseudorandom fashion, otherwise, in a random fashion. Check paper (Graham, 2015) for difference between pseudorandom and random.  
  overlapping   An optional bool. Defaults to False. When set to True, it means when pooling, the values at the boundary of adjacent pooling cells are used by both cells. For example: index 0 1 2 3 4 value 20 5 16 3 7 If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. The result would be [20, 16] for fractional avg pooling.  
  deterministic   An optional bool. Deprecated; use fractional_avg_pool_v2 instead.  
  seed   An optional int. Defaults to 0. If set to be non-zero, the random number generator is seeded by the given seed. Otherwise it is seeded by a random seed.  
  seed2   An optional int. Deprecated; use fractional_avg_pool_v2 instead.  
  name   A name for the operation (optional).   
 


 Returns
 A tuple of Tensor objects (output, row_pooling_sequence, col_pooling_sequence). output: Output Tensor after fractional avg pooling. Has the same type as value. row_pooling_sequence: A Tensor of type int64. col_pooling_sequence: A Tensor of type int64. References: Fractional Max-Pooling: Graham, 2015 (pdf)
tf.compat.v1.nn.fused_batch_norm Batch normalization. 
tf.compat.v1.nn.fused_batch_norm(
    x, scale, offset, mean=None, variance=None, epsilon=0.001,
    data_format='NHWC', is_training=True, name=None,
    exponential_avg_factor=1.0
)
 See Source: Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift; S. Ioffe, C. Szegedy.
 


 Args
  x   Input Tensor of 4 or 5 dimensions.  
  scale   A Tensor of 1 dimension for scaling.  
  offset   A Tensor of 1 dimension for bias.  
  mean   A Tensor of 1 dimension for population mean. The shape and meaning of this argument depends on the value of is_training and exponential_avg_factor as follows: is_trainingFalse (inference): Mean must be a Tensor of the same shape as scale containing the estimated population mean computed during training. is_trainingTrue and exponential_avg_factor == 1.0: Mean must be None. is_trainingTrue and exponential_avg_factor != 1.0: Mean must be a Tensor of the same shape as scale containing the exponential running mean. 
 
  variance   A Tensor of 1 dimension for population variance. The shape and meaning of this argument depends on the value of is_training and exponential_avg_factor as follows: is_trainingFalse (inference): Variance must be a Tensor of the same shape as scale containing the estimated population variance computed during training. is_training==True and exponential_avg_factor == 1.0: Variance must be None. is_training==True and exponential_avg_factor != 1.0: Variance must be a Tensor of the same shape as scale containing the exponential running variance.  
  epsilon   A small float number added to the variance of x.  
  data_format   The data format for x. Support "NHWC" (default) or "NCHW" for 4D tenors and "NDHWC" or "NCDHW" for 5D tensors.  
  is_training   A bool value to specify if the operation is used for training or inference.  
  name   A name for this operation (optional).  
  exponential_avg_factor   A float number (usually between 0 and 1) used for controlling the decay of the running population average of mean and variance. If set to 1.0, the current batch average is returned.   
 


 Returns
  y   A 4D or 5D Tensor for the normalized, scaled, offsetted x.  
  running_mean   A 1D Tensor for the exponential running mean of x. The output value is (1 - exponential_avg_factor) * mean + exponential_avg_factor * batch_mean), where batch_mean is the mean of the current batch in x.  
  running_var   A 1D Tensor for the exponential running variance The output value is (1 - exponential_avg_factor) * variance + exponential_avg_factor * batch_variance), where batch_variance is the variance of the current batch in x.    References: Batch Normalization - Accelerating Deep Network Training by Reducing Internal Covariate Shift: Ioffe et al., 2015 (pdf)