code: def GlobalAvgPooling(x, data_format="channels_last"):
      """
      Global average pooling as in the paper `Network In Network
      <http://arxiv.org/abs/1312.4400>`_.
  
      Args:
          x (tf.Tensor): a 4D tensor.
  
      Returns:
          tf.Tensor: a NC tensor named ``output``.
      """
      assert x.shape.ndims == 4
      data_format = get_data_format(data_format)
      axis = [1, 2] if data_format == "channels_last" else [2, 3]
      return tf.reduce_mean(x, axis, name="output")
  
file_path: tensorpack/tensorpack/models/pool.py
imports: import numpy
  from ..compat import tfv1
  from ..utils.argtools import get_data_format, shape2d
  from .common import layer_register
  from .shape_utils import StaticDynamicShape
  from .tflayer import convert_to_tflayer_args
label_desc: Use image node_id 3 for calling a global function with example usage: GlobalAvgPooling(x, data_format) and returns: tf