original_docstring: Average pools away spatial height and width dimension of 4D tensor.
docstring: Average pools away spatial height and width dimension of 4D tensor.
docstring_tokens: Average pools away spatial height and width dimension of 4D tensor .
code: def global_avg_pool(x, scope=None):
    """Average pools away spatial height and width dimension of 4D tensor."""
    assert x.get_shape().ndims == 4
    with tf.name_scope(scope, 'global_avg_pool', [x]):
      kernel_size = (1, int(x.shape[1]), int(x.shape[2]), 1)
      squeeze_dims = (1, 2)
      result = tf.nn.avg_pool(
          x,
          ksize=kernel_size,
          strides=(1, 1, 1, 1),
          padding='VALID',
          data_format='NHWC')
      return tf.squeeze(result, squeeze_dims)
code_tokens: def global_avg_pool ( x , scope = None ) : assert x . get_shape ( ) . ndims == 4 with tf . name_scope ( scope , 'global_avg_pool' , [ x ] ) : kernel_size = ( 1 , int ( x . shape [ 1 ] ) , int ( x . shape [ 2 ] ) , 1 ) squeeze_dims = ( 1 , 2 ) result = tf . nn . avg_pool ( x , ksize = kernel_size , strides = ( 1 , 1 , 1 , 1 ) , padding = 'VALID' , data_format = 'NHWC' ) return tf . squeeze ( result , squeeze_dims )
short_docstring: Average pools away spatial height and width dimension of 4D tensor.
short_docstring_tokens: Average pools away spatial height and width dimension of 4D tensor .
comment: """Average pools away spatial height and width dimension of 4D tensor."""