(inputs, filters, block_fn, blocks, dilation_rate, is_training, name,
                data_format)
return tf.identity(inputs, name)
Creates one layer of blocks for the ResNet model.

  Args:
    inputs: A tensor of size [batch, channels, height_in, width_in] or
      [batch, height_in, width_in, channels] depending on data_format.
    filters: The number of filters for the first convolution of the layer.
    block_fn: The block to use within the model, either `building_block` or
      `bottleneck_block`.
    blocks: The number of blocks contained in the layer.
    dilation_rate: The stride to use for the first convolution of the layer. If
      greater than 1, this layer will ultimately downsample the input.
    is_training: Either True or False, whether we are currently training the
      model. Needed for batch norm.
    name: A string name for the tensor output of the block layer.
    data_format: The input format ('channels_last' or 'channels_first').

  Returns:
    The output tensor of the block layer.
Creates one layer of blocks for the ResNet model.
Creates one layer of blocks for the ResNet model .
def xdet_block_layer(inputs, filters, block_fn, blocks, dilation_rate, is_training, name,
                data_format):
  """Creates one layer of blocks for the ResNet model.

  Args:
    inputs: A tensor of size [batch, channels, height_in, width_in] or
      [batch, height_in, width_in, channels] depending on data_format.
    filters: The number of filters for the first convolution of the layer.
    block_fn: The block to use within the model, either `building_block` or
      `bottleneck_block`.
    blocks: The number of blocks contained in the layer.
    dilation_rate: The stride to use for the first convolution of the layer. If
      greater than 1, this layer will ultimately downsample the input.
    is_training: Either True or False, whether we are currently training the
      model. Needed for batch norm.
    name: A string name for the tensor output of the block layer.
    data_format: The input format ('channels_last' or 'channels_first').

  Returns:
    The output tensor of the block layer.
  """
  # Bottleneck blocks end with 4x the number of filters as they start with
  filters_out = 4 * filters if block_fn is xdet_bottleneck_block else filters

  def projection_shortcut(inputs):
    return tf.layers.conv2d(
                            inputs=inputs, filters=filters_out, kernel_size=1, strides=1,
                            padding='SAME', use_bias=False,
                            kernel_initializer=tf.variance_scaling_initializer(),
                            data_format=data_format)

  # Only the first block per block_layer uses projection_shortcut and dilation_rate
  inputs = block_fn(inputs, filters, is_training, projection_shortcut, dilation_rate, data_format)

  for _ in range(1, blocks):
    inputs = block_fn(inputs, filters, is_training, None, dilation_rate, data_format)

  return tf.identity(inputs, name)
def xdet_block_layer ( inputs , filters , block_fn , blocks , dilation_rate , is_training , name , data_format ) : # Bottleneck blocks end with 4x the number of filters as they start with filters_out = 4 * filters if block_fn is xdet_bottleneck_block else filters def projection_shortcut ( inputs ) : return tf . layers . conv2d ( inputs = inputs , filters = filters_out , kernel_size = 1 , strides = 1 , padding = 'SAME' , use_bias = False , kernel_initializer = tf . variance_scaling_initializer ( ) , data_format = data_format ) # Only the first block per block_layer uses projection_shortcut and dilation_rate inputs = block_fn ( inputs , filters , is_training , projection_shortcut , dilation_rate , data_format ) for _ in range ( 1 , blocks ) : inputs = block_fn ( inputs , filters , is_training , None , dilation_rate , data_format ) return tf . identity ( inputs , name )