code: def final_block(x1, x2, dim='2d', training=True, scope='final_block'):
    
  
    # Final batch norm and relu
    with tf.variable_scope(scope):
      y = tf.concat([x1, x2], axis=CONFIG[dim]['split_axis'])
      y = tf.layers.batch_normalization(y, training=training)
      y = tf.nn.relu(y)
  
      # Global average pooling
      net = tf.reduce_mean(y, CONFIG[dim]['reduction_dimensions'],
                           name='final_pool', keep_dims=True)
  
      return net
docs: Converts activations from last RevNet block to pre-logits.
  
    Args:
      x1: [NxHxWxC] tensor of network activations.
      x2: [NxHxWxC] tensor of network activations.
      dim: '2d' if 2-dimensional, '3d' if 3-dimensional.
      training: True for train phase, False for eval phase.
      scope: Optional variable scope for the final block.
  
    Returns:
      [N, hidden_dim] pre-logits tensor from activations x1 and x2.