neulab/docprompting-conala huggingface dataset:
tf.raw_ops.SpaceToBatch SpaceToBatch for 4-D tensors of type T.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.SpaceToBatch  
tf.raw_ops.SpaceToBatch(
    input, paddings, block_size, name=None
)
 This is a legacy version of the more general SpaceToBatchND. Zero-pads and then rearranges (permutes) blocks of spatial data into batch. More specifically, this op outputs a copy of the input tensor where values from the height and width dimensions are moved to the batch dimension. After the zero-padding, both height and width of the input must be divisible by the block size.
 


 Args
  input   A Tensor. 4-D with shape [batch, height, width, depth].  
  paddings   A Tensor. Must be one of the following types: int32, int64. 2-D tensor of non-negative integers with shape [2, 2]. It specifies the padding of the input with zeros across the spatial dimensions as follows: paddings = [[pad_top, pad_bottom], [pad_left, pad_right]] The effective spatial dimensions of the zero-padded input tensor will be: height_pad = pad_top + height + pad_bottom width_pad = pad_left + width + pad_right The attr block_size must be greater than one. It indicates the block size.  Non-overlapping blocks of size block_size x block size in the height and width dimensions are rearranged into the batch dimension at each location. The batch of the output tensor is batch * block_size * block_size. Both height_pad and width_pad must be divisible by block_size.  The shape of the output will be: [batchblock_sizeblock_size, height_pad/block_size, width_pad/block_size, depth] Some examples: (1) For the following input of shape [1, 2, 2, 1] and block_size of 2: x = [[[[1], [2]], [[3], [4]]]]
 The output tensor has shape [4, 1, 1, 1] and value: [[[[1]]], [[[2]]], [[[3]]], [[[4]]]]
 (2) For the following input of shape [1, 2, 2, 3] and block_size of 2: x = [[[[1, 2, 3], [4, 5, 6]],
[[7, 8, 9], [10, 11, 12]]]]
 The output tensor has shape [4, 1, 1, 3] and value: [[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]
 (3) For the following input of shape [1, 4, 4, 1] and block_size of 2: x = [[[[1],   [2],  [3],  [4]],
[[5],   [6],  [7],  [8]],
[[9],  [10], [11],  [12]],
[[13], [14], [15],  [16]]]]
 The output tensor has shape [4, 2, 2, 1] and value: x = [[[[1], [3]], [[9], [11]]],
[[[2], [4]], [[10], [12]]],
[[[5], [7]], [[13], [15]]],
[[[6], [8]], [[14], [16]]]]
 (4) For the following input of shape [2, 2, 4, 1] and block_size of 2: x = [[[[1],   [2],  [3],  [4]],
[[5],   [6],  [7],  [8]]],
[[[9],  [10], [11],  [12]],
[[13], [14], [15],  [16]]]]
 The output tensor has shape [8, 1, 2, 1] and value: x = [[[[1], [3]]], [[[9], [11]]], [[[2], [4]]], [[[10], [12]]],
[[[5], [7]]], [[[13], [15]]], [[[6], [8]]], [[[14], [16]]]]
 Among others, this operation is useful for reducing atrous convolution into regular convolution. 
 
  block_size   An int that is >= 2.  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as input.
tf.raw_ops.SpaceToDepth SpaceToDepth for tensors of type T.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.SpaceToDepth  
tf.raw_ops.SpaceToDepth(
    input, block_size, data_format='NHWC', name=None
)
 Rearranges blocks of spatial data, into depth. More specifically, this op outputs a copy of the input tensor where values from the height and width dimensions are moved to the depth dimension. The attr block_size indicates the input block size.  Non-overlapping blocks of size block_size x block size are rearranged into depth at each location. The depth of the output tensor is block_size * block_size * input_depth. The Y, X coordinates within each block of the input become the high order component of the output channel index. The input tensor's height and width must be divisible by block_size.  The data_format attr specifies the layout of the input and output tensors with the following options: "NHWC": [ batch, height, width, channels ] "NCHW": [ batch, channels, height, width ] "NCHW_VECT_C": qint8 [ batch, channels / 4, height, width, 4 ] It is useful to consider the operation as transforming a 6-D Tensor. e.g. for data_format = NHWC, Each element in the input tensor can be specified via 6 coordinates, ordered by decreasing memory layout significance as: n,oY,bY,oX,bX,iC (where n=batch index, oX, oY means X or Y coordinates within the output image, bX, bY means coordinates within the input block, iC means input channels). The output would be a transpose to the following layout: n,oY,oX,bY,bX,iC This operation is useful for resizing the activations between convolutions (but keeping all data), e.g. instead of pooling. It is also useful for training purely convolutional models. For example, given an input of shape [1, 2, 2, 1], data_format = "NHWC" and block_size = 2: x = [[[[1], [2]],
      [[3], [4]]]]
 This operation will output a tensor of shape [1, 1, 1, 4]: [[[[1, 2, 3, 4]]]]
 Here, the input has a batch of 1 and each batch element has shape [2, 2, 1], the corresponding output will have a single element (i.e. width and height are both 1) and will have a depth of 4 channels (1 * block_size * block_size). The output element shape is [1, 1, 4]. For an input tensor with larger depth, here of shape [1, 2, 2, 3], e.g. x = [[[[1, 2, 3], [4, 5, 6]],
      [[7, 8, 9], [10, 11, 12]]]]
 This operation, for block_size of 2, will return the following tensor of shape [1, 1, 1, 12] [[[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]]]]
 Similarly, for the following input of shape [1 4 4 1], and a block size of 2: x = [[[[1],   [2],  [5],  [6]],
      [[3],   [4],  [7],  [8]],
      [[9],  [10], [13],  [14]],
      [[11], [12], [15],  [16]]]]
 the operator will return the following tensor of shape [1 2 2 4]: x = [[[[1, 2, 3, 4],
       [5, 6, 7, 8]],
      [[9, 10, 11, 12],
       [13, 14, 15, 16]]]]

 


 Args
  input   A Tensor.  
  block_size   An int that is >= 2. The size of the spatial block.  
  data_format   An optional string from: "NHWC", "NCHW", "NCHW_VECT_C". Defaults to "NHWC".  
  name   A name for the operation (optional).   
 


 Returns   A Tensor. Has the same type as input.
tf.raw_ops.SparseAccumulatorApplyGradient Applies a sparse gradient to a given accumulator.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.SparseAccumulatorApplyGradient  
tf.raw_ops.SparseAccumulatorApplyGradient(
    handle, local_step, gradient_indices, gradient_values, gradient_shape,
    has_known_shape, name=None
)
 Does not add if local_step is smaller 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 sparse gradient was computed.  
  gradient_indices   A Tensor of type int64. Indices of the sparse gradient to be accumulated. Must be a vector.  
  gradient_values   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. Values are the non-zero slices of the gradient, and must have the same first dimension as indices, i.e., the nnz represented by indices and values must be consistent.  
  gradient_shape   A Tensor of type int64. Shape of the sparse gradient to be accumulated.  
  has_known_shape   A bool. Boolean indicating whether gradient_shape is unknown, in which case the input is ignored during validation.  
  name   A name for the operation (optional).   
 


 Returns   The created Operation.
tf.raw_ops.SparseAccumulatorTakeGradient Extracts the average sparse gradient in a SparseConditionalAccumulator.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.SparseAccumulatorTakeGradient  
tf.raw_ops.SparseAccumulatorTakeGradient(
    handle, num_required, dtype, name=None
)
 The op will blocks until sufficient (i.e., more than num_required) gradients have been accumulated. If the accumulator has already aggregated more than num_required gradients, it will return its average of the accumulated gradients. Also automatically increments the recorded global_step in the accumulator by 1, and resets the aggregate to 0.
 


 Args
  handle   A Tensor of type mutable string. The handle to a SparseConditionalAccumulator.  
  num_required   A Tensor of type int32. Number of gradients required before we return an aggregate.  
  dtype   A tf.DType from: tf.float32, tf.float64, tf.int32, tf.uint8, tf.int16, tf.int8, tf.complex64, tf.int64, tf.qint8, tf.quint8, tf.qint32, tf.bfloat16, tf.uint16, tf.complex128, tf.half, tf.uint32, tf.uint64. The data type of accumulated gradients. Needs to correspond to the type of the accumulator.  
  name   A name for the operation (optional).   
 


 Returns   A tuple of Tensor objects (indices, values, shape).     indices   A Tensor of type int64.  
  values   A Tensor of type dtype.  
  shape   A Tensor of type int64.
tf.raw_ops.SparseAdd Adds two SparseTensor objects to produce another SparseTensor.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.SparseAdd  
tf.raw_ops.SparseAdd(
    a_indices, a_values, a_shape, b_indices, b_values, b_shape, thresh, name=None
)
 The input SparseTensor objects' indices are assumed ordered in standard lexicographic order. If this is not the case, before this step run SparseReorder to restore index ordering. By default, if two values sum to zero at some index, the output SparseTensor would still include that particular location in its index, storing a zero in the corresponding value slot. To override this, callers can specify thresh, indicating that if the sum has a magnitude strictly smaller than thresh, its corresponding value and index would then not be included. In particular, thresh == 0 (default) means everything is kept and actual thresholding happens only for a positive value. In the following shapes, nnz is the count after taking thresh into account.
 


 Args
  a_indices   A Tensor of type int64. 2-D. The indices of the first SparseTensor, size [nnz, ndims] Matrix.  
  a_values   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. 1-D. The values of the first SparseTensor, size [nnz] Vector.  
  a_shape   A Tensor of type int64. 1-D. The shape of the first SparseTensor, size [ndims] Vector.  
  b_indices   A Tensor of type int64. 2-D. The indices of the second SparseTensor, size [nnz, ndims] Matrix.  
  b_values   A Tensor. Must have the same type as a_values. 1-D. The values of the second SparseTensor, size [nnz] Vector.  
  b_shape   A Tensor of type int64. 1-D. The shape of the second SparseTensor, size [ndims] Vector.  
  thresh   A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64. 0-D. The magnitude threshold that determines if an output value/index pair takes space.  
  name   A name for the operation (optional).   
 


 Returns   A tuple of Tensor objects (sum_indices, sum_values, sum_shape).     sum_indices   A Tensor of type int64.  
  sum_values   A Tensor. Has the same type as a_values.  
  sum_shape   A Tensor of type int64.
tf.raw_ops.SparseAddGrad The gradient operator for the SparseAdd op.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.SparseAddGrad  
tf.raw_ops.SparseAddGrad(
    backprop_val_grad, a_indices, b_indices, sum_indices, name=None
)
 The SparseAdd op calculates A + B, where A, B, and the sum are all represented as SparseTensor objects. This op takes in the upstream gradient w.r.t. non-empty values of the sum, and outputs the gradients w.r.t. the non-empty values of A and B.
 


 Args
  backprop_val_grad   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. 1-D with shape [nnz(sum)]. The gradient with respect to the non-empty values of the sum.  
  a_indices   A Tensor of type int64. 2-D. The indices of the SparseTensor A, size [nnz(A), ndims].  
  b_indices   A Tensor of type int64. 2-D. The indices of the SparseTensor B, size [nnz(B), ndims].  
  sum_indices   A Tensor of type int64. 2-D. The indices of the sum SparseTensor, size [nnz(sum), ndims].  
  name   A name for the operation (optional).   
 


 Returns   A tuple of Tensor objects (a_val_grad, b_val_grad).     a_val_grad   A Tensor. Has the same type as backprop_val_grad.  
  b_val_grad   A Tensor. Has the same type as backprop_val_grad.
tf.raw_ops.SparseApplyAdadelta var: Should be from a Variable().  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.SparseApplyAdadelta  
tf.raw_ops.SparseApplyAdadelta(
    var, accum, accum_update, lr, rho, epsilon, grad, indices, use_locking=False,
    name=None
)

 


 Args  
  var
  A mutable 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.


  accum
  A mutable Tensor. Must have the same type as var. Should be from a Variable().


  accum_update
 
 A mutable Tensor. Must have the same type as var. Should be from a Variable(). 
 

  lr   A Tensor. Must have the same type as var. Learning rate. Must be a scalar.  
  rho   A Tensor. Must have the same type as var. Decay factor. Must be a scalar.  
  epsilon   A Tensor. Must have the same type as var. Constant factor. Must be a scalar.  
  grad   A Tensor. Must have the same type as var. The gradient.  
  indices   A Tensor. Must be one of the following types: int32, int64. A vector of indices into the first dimension of var and accum.  
  use_locking   An optional bool. Defaults to False. If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.  
  name   A name for the operation (optional).   


 


 Returns   A mutable Tensor. Has the same type as var.
tf.raw_ops.SparseApplyAdagrad   Update relevant entries in 'var' and 'accum' according to the adagrad scheme.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.SparseApplyAdagrad  
tf.raw_ops.SparseApplyAdagrad(
    var, accum, lr, grad, indices, use_locking=False, update_slots=True, name=None
)
 That is for rows we have grad for, we update var and accum as follows:  $$accum += grad * grad$$   $$var -= lr * grad * (1 / sqrt(accum))$$ 
 


 Args
  var   A mutable 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. Should be from a Variable().  
  accum   A mutable Tensor. Must have the same type as var. Should be from a Variable().  
  lr   A Tensor. Must have the same type as var. Learning rate. Must be a scalar.  
  grad   A Tensor. Must have the same type as var. The gradient.  
  indices   A Tensor. Must be one of the following types: int32, int64. A vector of indices into the first dimension of var and accum.  
  use_locking   An optional bool. Defaults to False. If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.  
  update_slots   An optional bool. Defaults to True.  
  name   A name for the operation (optional).   
 


 Returns   A mutable Tensor. Has the same type as var.
tf.raw_ops.SparseApplyAdagradDA Update entries in 'var' and 'accum' according to the proximal adagrad scheme.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.SparseApplyAdagradDA  
tf.raw_ops.SparseApplyAdagradDA(
    var, gradient_accumulator, gradient_squared_accumulator, grad, indices, lr, l1,
    l2, global_step, use_locking=False, name=None
)

 


 Args
  var   A mutable 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. Should be from a Variable().  
  gradient_accumulator   A mutable Tensor. Must have the same type as var. Should be from a Variable().  
  gradient_squared_accumulator   A mutable Tensor. Must have the same type as var. Should be from a Variable().  
  grad   A Tensor. Must have the same type as var. The gradient.  
  indices   A Tensor. Must be one of the following types: int32, int64. A vector of indices into the first dimension of var and accum.  
  lr   A Tensor. Must have the same type as var. Learning rate. Must be a scalar.  
  l1   A Tensor. Must have the same type as var. L1 regularization. Must be a scalar.  
  l2   A Tensor. Must have the same type as var. L2 regularization. Must be a scalar.  
  global_step   A Tensor of type int64. Training step number. Must be a scalar.  
  use_locking   An optional bool. Defaults to False. If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.  
  name   A name for the operation (optional).   
 


 Returns   A mutable Tensor. Has the same type as var.
tf.raw_ops.SparseApplyAdagradV2   Update relevant entries in 'var' and 'accum' according to the adagrad scheme.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.SparseApplyAdagradV2  
tf.raw_ops.SparseApplyAdagradV2(
    var, accum, lr, epsilon, grad, indices, use_locking=False, update_slots=True,
    name=None
)
 That is for rows we have grad for, we update var and accum as follows:  $$accum += grad * grad$$   $$var -= lr * grad * (1 / sqrt(accum))$$ 
 


 Args
  var   A mutable 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. Should be from a Variable().  
  accum   A mutable Tensor. Must have the same type as var. Should be from a Variable().  
  lr   A Tensor. Must have the same type as var. Learning rate. Must be a scalar.  
  epsilon   A Tensor. Must have the same type as var. Constant factor. Must be a scalar.  
  grad   A Tensor. Must have the same type as var. The gradient.  
  indices   A Tensor. Must be one of the following types: int32, int64. A vector of indices into the first dimension of var and accum.  
  use_locking   An optional bool. Defaults to False. If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.  
  update_slots   An optional bool. Defaults to True.  
  name   A name for the operation (optional).   
 


 Returns   A mutable Tensor. Has the same type as var.
tf.raw_ops.SparseApplyCenteredRMSProp   Update '*var' according to the centered RMSProp algorithm.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.SparseApplyCenteredRMSProp  
tf.raw_ops.SparseApplyCenteredRMSProp(
    var, mg, ms, mom, lr, rho, momentum, epsilon, grad, indices, use_locking=False,
    name=None
)
 The centered RMSProp algorithm uses an estimate of the centered second moment (i.e., the variance) for normalization, as opposed to regular RMSProp, which uses the (uncentered) second moment. This often helps with training, but is slightly more expensive in terms of computation and memory. Note that in dense implementation of this algorithm, mg, ms, and mom will update even if the grad is zero, but in this sparse implementation, mg, ms, and mom will not update in iterations during which the grad is zero. mean_square = decay * mean_square + (1-decay) * gradient ** 2 mean_grad = decay * mean_grad + (1-decay) * gradient Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2)  $$ms  $$mom  $$var  
 


 Args
  var   A mutable 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. Should be from a Variable().  
  mg   A mutable Tensor. Must have the same type as var. Should be from a Variable().  
  ms   A mutable Tensor. Must have the same type as var. Should be from a Variable().  
  mom   A mutable Tensor. Must have the same type as var. Should be from a Variable().  
  lr   A Tensor. Must have the same type as var. Scaling factor. Must be a scalar.  
  rho   A Tensor. Must have the same type as var. Decay rate. Must be a scalar.  
  momentum   A Tensor. Must have the same type as var.  
  epsilon   A Tensor. Must have the same type as var. Ridge term. Must be a scalar.  
  grad   A Tensor. Must have the same type as var. The gradient.  
  indices   A Tensor. Must be one of the following types: int32, int64. A vector of indices into the first dimension of var, ms and mom.  
  use_locking   An optional bool. Defaults to False. If True, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.  
  name   A name for the operation (optional).   
 


 Returns   A mutable Tensor. Has the same type as var.  
     Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license. Last updated 2021-02-18 UTC.        Stay connected    Blog     GitHub     Twitter     YouTube      Support    Issue tracker     Release notes     Stack Overflow     Brand guidelines     Cite TensorFlow              Terms     Privacy    Sign up for the TensorFlow monthly newsletter  Subscribe       Language  English   中文 – 简体
tf.raw_ops.SparseApplyFtrl   Update relevant entries in '*var' according to the Ftrl-proximal scheme.  View aliases  Compat aliases for migration 
See Migration guide for more details. tf.compat.v1.raw_ops.SparseApplyFtrl  
tf.raw_ops.SparseApplyFtrl(
    var, accum, linear, grad, indices, lr, l1, l2, lr_power, use_locking=False,
    multiply_linear_by_lr=False, name=None
)
 That is for rows we have grad for, we update var, accum and linear as follows:  $$accum_new = accum + grad * grad$$   $$linear += grad + (accum_{new}^{-lr_{power} } - accum^{-lr_{power} } / lr * var$$   $$quadratic = 1.0 / (accum_{new}^{lr_{power} } * lr) + 2 * l2$$   $$var = (sign(linear) * l1 - linear) / quadratic\ if\ |linear| > l1\ else\ 0.0$$   $$accum = accum_{new}$$ 
 


 Args
  var   A mutable 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. Should be from a Variable().  
  accum   A mutable Tensor. Must have the same type as var. Should be from a Variable().  
  linear   A mutable Tensor. Must have the same type as var. Should be from a Variable().  
  grad   A Tensor. Must have the same type as var. The gradient.  
  indices   A Tensor. Must be one of the following types: int32, int64. A vector of indices into the first dimension of var and accum.  
  lr   A Tensor. Must have the same type as var. Scaling factor. Must be a scalar.  
  l1   A Tensor. Must have the same type as var. L1 regularization. Must be a scalar.  
  l2   A Tensor. Must have the same type as var. L2 regularization. Must be a scalar.  
  lr_power   A Tensor. Must have the same type as var. Scaling factor. Must be a scalar.  
  use_locking   An optional bool. Defaults to False. If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.  
  multiply_linear_by_lr   An optional bool. Defaults to False.  
  name   A name for the operation (optional).   
 


 Returns   A mutable Tensor. Has the same type as var.