code: def global_pool(input_tensor, pool_op=tf.nn.avg_pool):
      """Applies avg pool to produce 1x1 output.
  
      NOTE: This function is funcitonally equivalenet to reduce_mean, but it has
      baked in average pool which has better support across hardware.
  
      Args:
        input_tensor: input tensor
        pool_op: pooling op (avg pool is default)
      Returns:
        a tensor batch_size x 1 x 1 x depth.
      """
      shape = input_tensor.get_shape().as_list()
      if shape[1] is None or shape[2] is None:
          kernel_size = tf.convert_to_tensor(
              [
                  1,
                  tf.shape(input_tensor)[1],
                  tf.shape(input_tensor)[2],
                  1,
              ]
          )
      else:
          kernel_size = [1, shape[1], shape[2], 1]
      output = pool_op(
          input_tensor,
          ksize=kernel_size,
          strides=[1, 1, 1, 1],
          padding="VALID",
      )
      # Recover output shape, for unknown shape.
      output.set_shape([None, 1, 1, None])
      return output
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import contextlib
  import copy
  import os
  import tensorflow
label_desc: Use image node_id 11 for calling a global function with example usage: global_pool(input_tensor, pool_op) and returns: output