neulab/docprompting-conala huggingface dataset:
tf.compat.v1.layers.AveragePooling3D Average pooling layer for 3D inputs (e.g. volumes). Inherits From: AveragePooling3D, Layer, Layer, Module 
tf.compat.v1.layers.AveragePooling3D(
    pool_size, strides, padding='valid',
    data_format='channels_last', name=None, **kwargs
)

 


 Arguments
  pool_size   An integer or tuple/list of 3 integers: (pool_depth, pool_height, pool_width) specifying the size of the pooling window. Can be a single integer to specify the same value for all spatial dimensions.  
  strides   An integer or tuple/list of 3 integers, specifying the strides of the pooling operation. Can be a single integer to specify the same value for all spatial dimensions.  
  padding   A string. The padding method, either 'valid' or 'same'. Case-insensitive.  
  data_format   A string. The ordering of the dimensions in the inputs. channels_last (default) and channels_first are supported. channels_last corresponds to inputs with shape (batch, depth, height, width, channels) while channels_first corresponds to inputs with shape (batch, channels, depth, height, width).  
  name   A string, the name of the layer.   
 


 Attributes
  graph  
 
  scope_name
tf.compat.v1.layers.average_pooling1d Average Pooling layer for 1D inputs. 
tf.compat.v1.layers.average_pooling1d(
    inputs, pool_size, strides, padding='valid',
    data_format='channels_last', name=None
)

 


 Arguments
  inputs   The tensor over which to pool. Must have rank 3.  
  pool_size   An integer or tuple/list of a single integer, representing the size of the pooling window.  
  strides   An integer or tuple/list of a single integer, specifying the strides of the pooling operation.  
  padding   A string. The padding method, either 'valid' or 'same'. Case-insensitive.  
  data_format   A string, one of channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, length, channels) while channels_first corresponds to inputs with shape (batch, channels, length).  
  name   A string, the name of the layer.   
 


 Returns   The output tensor, of rank 3.  

 


 Raises
  ValueError   if eager execution is enabled.
tf.compat.v1.layers.average_pooling2d Average pooling layer for 2D inputs (e.g. images). 
tf.compat.v1.layers.average_pooling2d(
    inputs, pool_size, strides, padding='valid',
    data_format='channels_last', name=None
)

 


 Arguments
  inputs   The tensor over which to pool. Must have rank 4.  
  pool_size   An integer or tuple/list of 2 integers: (pool_height, pool_width) specifying the size of the pooling window. Can be a single integer to specify the same value for all spatial dimensions.  
  strides   An integer or tuple/list of 2 integers, specifying the strides of the pooling operation. Can be a single integer to specify the same value for all spatial dimensions.  
  padding   A string. The padding method, either 'valid' or 'same'. Case-insensitive.  
  data_format   A string. The ordering of the dimensions in the inputs. channels_last (default) and channels_first are supported. channels_last corresponds to inputs with shape (batch, height, width, channels) while channels_first corresponds to inputs with shape (batch, channels, height, width).  
  name   A string, the name of the layer.   
 


 Returns   Output tensor.  

 


 Raises
  ValueError   if eager execution is enabled.
tf.compat.v1.layers.average_pooling3d Average pooling layer for 3D inputs (e.g. volumes). 
tf.compat.v1.layers.average_pooling3d(
    inputs, pool_size, strides, padding='valid',
    data_format='channels_last', name=None
)

 


 Arguments
  inputs   The tensor over which to pool. Must have rank 5.  
  pool_size   An integer or tuple/list of 3 integers: (pool_depth, pool_height, pool_width) specifying the size of the pooling window. Can be a single integer to specify the same value for all spatial dimensions.  
  strides   An integer or tuple/list of 3 integers, specifying the strides of the pooling operation. Can be a single integer to specify the same value for all spatial dimensions.  
  padding   A string. The padding method, either 'valid' or 'same'. Case-insensitive.  
  data_format   A string. The ordering of the dimensions in the inputs. channels_last (default) and channels_first are supported. channels_last corresponds to inputs with shape (batch, depth, height, width, channels) while channels_first corresponds to inputs with shape (batch, channels, depth, height, width).  
  name   A string, the name of the layer.   
 


 Returns   Output tensor.  

 


 Raises
  ValueError   if eager execution is enabled.
tf.compat.v1.layers.Conv2DTranspose Transposed 2D convolution layer (sometimes called 2D Deconvolution). Inherits From: Conv2DTranspose, Conv2D, Layer, Layer, Module 
tf.compat.v1.layers.Conv2DTranspose(
    filters, kernel_size, strides=(1, 1), padding='valid',
    data_format='channels_last', activation=None, use_bias=True,
    kernel_initializer=None, bias_initializer=tf.zeros_initializer(),
    kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None,
    kernel_constraint=None, bias_constraint=None, trainable=True, name=None,
    **kwargs
)
 The need for transposed convolutions generally arises from the desire to use a transformation going in the opposite direction of a normal convolution, i.e., from something that has the shape of the output of some convolution to something that has the shape of its input while maintaining a connectivity pattern that is compatible with said convolution.
 


 Arguments
  filters   Integer, the dimensionality of the output space (i.e. the number of filters in the convolution).  
  kernel_size   A tuple or list of 2 positive integers specifying the spatial dimensions of the filters. Can be a single integer to specify the same value for all spatial dimensions.  
  strides   A tuple or list of 2 positive integers specifying the strides of the convolution. Can be a single integer to specify the same value for all spatial dimensions.  
  padding   one of "valid" or "same" (case-insensitive). "valid" means no padding. "same" results in padding evenly to the left/right or up/down of the input such that output has the same height/width dimension as the input.  
  data_format   A string, one of channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, height, width, channels) while channels_first corresponds to inputs with shape (batch, channels, height, width).  
  activation   Activation function. Set it to None to maintain a linear activation.  
  use_bias   Boolean, whether the layer uses a bias.  
  kernel_initializer   An initializer for the convolution kernel.  
  bias_initializer   An initializer for the bias vector. If None, the default initializer will be used.  
  kernel_regularizer   Optional regularizer for the convolution kernel.  
  bias_regularizer   Optional regularizer for the bias vector.  
  activity_regularizer   Optional regularizer function for the output.  
  kernel_constraint   Optional projection function to be applied to the kernel after being updated by an Optimizer (e.g. used to implement norm constraints or value constraints for layer weights). The function must take as input the unprojected variable and must return the projected variable (which must have the same shape). Constraints are not safe to use when doing asynchronous distributed training.  
  bias_constraint   Optional projection function to be applied to the bias after being updated by an Optimizer.  
  trainable   Boolean, if True also add variables to the graph collection GraphKeys.TRAINABLE_VARIABLES (see tf.Variable).  
  name   A string, the name of the layer.   
 


 Attributes
  graph  
 
  scope_name
tf.compat.v1.layers.Conv3DTranspose Transposed 3D convolution layer (sometimes called 3D Deconvolution). Inherits From: Conv3DTranspose, Conv3D, Layer, Layer, Module 
tf.compat.v1.layers.Conv3DTranspose(
    filters, kernel_size, strides=(1, 1, 1), padding='valid',
    data_format='channels_last', activation=None, use_bias=True,
    kernel_initializer=None, bias_initializer=tf.zeros_initializer(),
    kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None,
    kernel_constraint=None, bias_constraint=None, trainable=True, name=None,
    **kwargs
)

 


 Arguments
  filters   Integer, the dimensionality of the output space (i.e. the number of filters in the convolution).  
  kernel_size   An integer or tuple/list of 3 integers, specifying the depth, height and width of the 3D convolution window. Can be a single integer to specify the same value for all spatial dimensions.  
  strides   An integer or tuple/list of 3 integers, specifying the strides of the convolution along the depth, height and width. Can be a single integer to specify the same value for all spatial dimensions.  
  padding   One of "valid" or "same" (case-insensitive). "valid" means no padding. "same" results in padding evenly to the left/right or up/down of the input such that output has the same height/width dimension as the input.  
  data_format   A string, one of channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, depth, height, width, channels) while channels_first corresponds to inputs with shape (batch, channels, depth, height, width).  
  activation   Activation function. Set it to None to maintain a linear activation.  
  use_bias   Boolean, whether the layer uses a bias.  
  kernel_initializer   An initializer for the convolution kernel.  
  bias_initializer   An initializer for the bias vector. If None, the default initializer will be used.  
  kernel_regularizer   Optional regularizer for the convolution kernel.  
  bias_regularizer   Optional regularizer for the bias vector.  
  activity_regularizer   Optional regularizer function for the output.  
  kernel_constraint   Optional projection function to be applied to the kernel after being updated by an Optimizer (e.g. used to implement norm constraints or value constraints for layer weights). The function must take as input the unprojected variable and must return the projected variable (which must have the same shape). Constraints are not safe to use when doing asynchronous distributed training.  
  bias_constraint   Optional projection function to be applied to the bias after being updated by an Optimizer.  
  trainable   Boolean, if True also add variables to the graph collection GraphKeys.TRAINABLE_VARIABLES (see tf.Variable).  
  name   A string, the name of the layer.   
 


 Attributes
  graph  
 
  scope_name
tf.compat.v1.layers.conv3d_transpose Functional interface for transposed 3D convolution layer. 
tf.compat.v1.layers.conv3d_transpose(
    inputs, filters, kernel_size, strides=(1, 1, 1), padding='valid',
    data_format='channels_last', activation=None, use_bias=True,
    kernel_initializer=None, bias_initializer=tf.zeros_initializer(),
    kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None,
    kernel_constraint=None, bias_constraint=None, trainable=True, name=None,
    reuse=None
)

 


 Arguments
  inputs   Input tensor.  
  filters   Integer, the dimensionality of the output space (i.e. the number of filters in the convolution).  
  kernel_size   A tuple or list of 3 positive integers specifying the spatial dimensions of the filters. Can be a single integer to specify the same value for all spatial dimensions.  
  strides   A tuple or list of 3 positive integers specifying the strides of the convolution. Can be a single integer to specify the same value for all spatial dimensions.  
  padding   one of "valid" or "same" (case-insensitive). "valid" means no padding. "same" results in padding evenly to the left/right or up/down of the input such that output has the same height/width dimension as the input.  
  data_format   A string, one of channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, depth, height, width, channels) while channels_first corresponds to inputs with shape (batch, channels, depth, height, width).  
  activation   Activation function. Set it to None to maintain a linear activation.  
  use_bias   Boolean, whether the layer uses a bias.  
  kernel_initializer   An initializer for the convolution kernel.  
  bias_initializer   An initializer for the bias vector. If None, the default initializer will be used.  
  kernel_regularizer   Optional regularizer for the convolution kernel.  
  bias_regularizer   Optional regularizer for the bias vector.  
  activity_regularizer   Optional regularizer function for the output.  
  kernel_constraint   Optional projection function to be applied to the kernel after being updated by an Optimizer (e.g. used to implement norm constraints or value constraints for layer weights). The function must take as input the unprojected variable and must return the projected variable (which must have the same shape). Constraints are not safe to use when doing asynchronous distributed training.  
  bias_constraint   Optional projection function to be applied to the bias after being updated by an Optimizer.  
  trainable   Boolean, if True also add variables to the graph collection GraphKeys.TRAINABLE_VARIABLES (see tf.Variable).  
  name   A string, the name of the layer.  
  reuse   Boolean, whether to reuse the weights of a previous layer by the same name.   
 


 Returns   Output tensor.  

 


 Raises
  ValueError   if eager execution is enabled.
tf.compat.v1.layers.Dense Densely-connected layer class. Inherits From: Dense, Layer, Layer, Module 
tf.compat.v1.layers.Dense(
    units, activation=None, use_bias=True, kernel_initializer=None,
    bias_initializer=tf.zeros_initializer(), kernel_regularizer=None,
    bias_regularizer=None, activity_regularizer=None, kernel_constraint=None,
    bias_constraint=None, trainable=True, name=None, **kwargs
)
 This layer implements the operation: outputs = activation(inputs * kernel + bias) Where activation is the activation function passed as the activation argument (if not None), kernel is a weights matrix created by the layer, and bias is a bias vector created by the layer (only if use_bias is True).
 


 Arguments
  units   Integer or Long, dimensionality of the output space.  
  activation   Activation function (callable). Set it to None to maintain a linear activation.  
  use_bias   Boolean, whether the layer uses a bias.  
  kernel_initializer   Initializer function for the weight matrix. If None (default), weights are initialized using the default initializer used by tf.compat.v1.get_variable.  
  bias_initializer   Initializer function for the bias.  
  kernel_regularizer   Regularizer function for the weight matrix.  
  bias_regularizer   Regularizer function for the bias.  
  activity_regularizer   Regularizer function for the output.  
  kernel_constraint   An optional projection function to be applied to the kernel after being updated by an Optimizer (e.g. used to implement norm constraints or value constraints for layer weights). The function must take as input the unprojected variable and must return the projected variable (which must have the same shape). Constraints are not safe to use when doing asynchronous distributed training.  
  bias_constraint   An optional projection function to be applied to the bias after being updated by an Optimizer.  
  trainable   Boolean, if True also add variables to the graph collection GraphKeys.TRAINABLE_VARIABLES (see tf.Variable).  
  name   String, the name of the layer. Layers with the same name will share weights, but to avoid mistakes we require reuse=True in such cases.  
  _reuse   Boolean, whether to reuse the weights of a previous layer by the same name.    Properties:  
units: Python integer, dimensionality of the output space. 
activation: Activation function (callable). 
use_bias: Boolean, whether the layer uses a bias. 
kernel_initializer: Initializer instance (or name) for the kernel matrix. 
bias_initializer: Initializer instance (or name) for the bias. 
kernel_regularizer: Regularizer instance for the kernel matrix (callable) 
bias_regularizer: Regularizer instance for the bias (callable). 
activity_regularizer: Regularizer instance for the output (callable) 
kernel_constraint: Constraint function for the kernel matrix. 
bias_constraint: Constraint function for the bias. 
kernel: Weight matrix (TensorFlow variable or tensor). 
bias: Bias vector, if applicable (TensorFlow variable or tensor). 
 


 Attributes
  graph  
 
  scope_name
tf.compat.v1.layers.Dropout Applies Dropout to the input. Inherits From: Dropout, Layer, Layer, Module 
tf.compat.v1.layers.Dropout(
    rate=0.5, noise_shape=None, seed=None, name=None, **kwargs
)
 Dropout consists in randomly setting a fraction rate of input units to 0 at each update during training time, which helps prevent overfitting. The units that are kept are scaled by 1 / (1 - rate), so that their sum is unchanged at training time and inference time.
 


 Arguments
  rate   The dropout rate, between 0 and 1. E.g. rate=0.1 would drop out 10% of input units.  
  noise_shape   1D tensor of type int32 representing the shape of the binary dropout mask that will be multiplied with the input. For instance, if your inputs have shape (batch_size, timesteps, features), and you want the dropout mask to be the same for all timesteps, you can use noise_shape=[batch_size, 1, features].  
  seed   A Python integer. Used to create random seeds. See tf.compat.v1.set_random_seed. for behavior.  
  name   The name of the layer (string).   
 


 Attributes
  graph  
 
  scope_name
Module: tf.compat.v1.layers.experimental Public API for tf.layers.experimental namespace. Functions keras_style_scope(...): Use Keras-style variable management. set_keras_style(...): Use Keras-style variable management.
tf.compat.v1.layers.experimental.keras_style_scope Use Keras-style variable management. 
@tf_contextlib.contextmanager
tf.compat.v1.layers.experimental.keras_style_scope()
 All tf.layers and tf RNN cells created in this scope use Keras-style variable management. Creating such layers with a scope= argument is disallowed, and reuse=True is disallowed. The purpose of this scope is to allow users of existing layers to slowly transition to a Keras layers API without breaking existing functionality. One example of this is when using TensorFlow's RNN classes with Keras Models or Networks. Because Keras models do not properly set variable scopes, users of RNNs may either accidentally share scopes between two different models, or get errors about variables that already exist. Example: class RNNModel(tf.keras.Model):

  def __init__(self, name):
    super(RNNModel, self).__init__(name=name)
    self.rnn = tf.compat.v1.nn.rnn_cell.MultiRNNCell(
      [tf.compat.v1.nn.rnn_cell.LSTMCell(64) for _ in range(2)])

  def call(self, input, state):
    return self.rnn(input, state)

model_1 = RNNModel("model_1")
model_2 = RNNModel("model_2")

# OK
output_1, next_state_1 = model_1(input, state)
# Raises an error about trying to create an already existing variable.
output_2, next_state_2 = model_2(input, state)
 The solution is to wrap the model construction and execution in a keras-style scope: with keras_style_scope():
  model_1 = RNNModel("model_1")
  model_2 = RNNModel("model_2")

  # model_1 and model_2 are guaranteed to create their own variables.
  output_1, next_state_1 = model_1(input, state)
  output_2, next_state_2 = model_2(input, state)

  assert len(model_1.weights) > 0
  assert len(model_2.weights) > 0
  assert(model_1.weights != model_2.weights)

 


 Yields   A keras layer style scope.
tf.compat.v1.layers.experimental.set_keras_style Use Keras-style variable management. 
tf.compat.v1.layers.experimental.set_keras_style()
 All tf.layers and tf RNN cells created after keras style ha been enabled use Keras-style variable management. Creating such layers with a scope= argument is disallowed, and reuse=True is disallowed. The purpose of this function is to allow users of existing layers to slowly transition to Keras layers API without breaking existing functionality. For more details, see the documentation for keras_style_scope. Note, once keras style has been set, it is set globally for the entire program and cannot be unset. Example: set_keras_style()

model_1 = RNNModel(name="model_1")
model_2 = RNNModel(name="model_2")

# model_1 and model_2 are guaranteed to create their own variables.
output_1, next_state_1 = model_1(input, state)
output_2, next_state_2 = model_2(input, state)

assert len(model_1.weights) > 0
assert len(model_2.weights) > 0
assert(model_1.weights != model_2.weights)
tf.compat.v1.layers.Flatten Flattens an input tensor while preserving the batch axis (axis 0). Inherits From: Flatten, Layer, Layer, Module 
tf.compat.v1.layers.Flatten(
    data_format=None, **kwargs
)

 


 Arguments
  data_format   A string, one of channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, ..., channels) while channels_first corresponds to inputs with shape (batch, channels, ...).    Examples: x = tf.compat.v1.placeholder(shape=(None, 4, 4), dtype='float32')
y = Flatten()(x)
# now `y` has shape `(None, 16)`

x = tf.compat.v1.placeholder(shape=(None, 3, None), dtype='float32')
y = Flatten()(x)
# now `y` has shape `(None, None)`

 


 Attributes
  graph  
 
  scope_name
tf.compat.v1.layers.Layer Base layer class. Inherits From: Layer, Module 
tf.compat.v1.layers.Layer(
    trainable=True, name=None, dtype=None, **kwargs
)
 It is considered legacy, and we recommend the use of tf.keras.layers.Layer instead.
 


 Arguments
  trainable   Boolean, whether the layer's variables should be trainable.  
  name   String name of the layer.  
  dtype   Default dtype of the layer's weights (default of None means use the type of the first input).    Read-only properties: name: The name of the layer (string). dtype: Default dtype of the layer's weights (default of None means use the type of the first input). trainable_variables: List of trainable variables. non_trainable_variables: List of non-trainable variables. variables: List of all variables of this layer, trainable and non-trainable. updates: List of update ops of this layer. losses: List of losses added by this layer. trainable_weights: List of variables to be included in backprop. non_trainable_weights: List of variables that should not be included in backprop. weights: The concatenation of the lists trainable_weights and non_trainable_weights (in this order). Mutable properties:  
trainable: Whether the layer should be trained (boolean). 
input_spec: Optional (list of) InputSpec object(s) specifying the constraints on inputs that can be accepted by the layer. 
 


 Attributes
  graph  
 
  scope_name
tf.compat.v1.layers.MaxPooling1D Max Pooling layer for 1D inputs. Inherits From: MaxPool1D, Layer, Layer, Module 
tf.compat.v1.layers.MaxPooling1D(
    pool_size, strides, padding='valid',
    data_format='channels_last', name=None, **kwargs
)

 


 Arguments
  pool_size   An integer or tuple/list of a single integer, representing the size of the pooling window.  
  strides   An integer or tuple/list of a single integer, specifying the strides of the pooling operation.  
  padding   A string. The padding method, either 'valid' or 'same'. Case-insensitive.  
  data_format   A string, one of channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, length, channels) while channels_first corresponds to inputs with shape (batch, channels, length).  
  name   A string, the name of the layer.   
 


 Attributes
  graph  
 
  scope_name