class_docstr: Pooling layer (global pooling) (specification key: `pooling`).
  
  Args:
      reduction ('concat' | 'max' | 'mean' | 'product' | 'sum'): Pooling type
          (<span style="color:#C00000"><b>required</b></span>).
      name (string): Layer name
          (<span style="color:#00C000"><b>default</b></span>: internally chosen).
      input_spec (specification): <span style="color:#00C000"><b>internal use</b></span>.
class_docstr_tok: ["Pooling","layer","(","global","pooling",")","(","specification","key",":","`","pooling","`",")",".","Args",":","reduction","(","'concat","'","|","'max","'","|","'mean","'","|","'product","'","|","'sum","'",")",":","Pooling","type","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","name","(","string",")",":","Layer","name","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","internally","chosen",")",".","input_spec","(","specification",")",":","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">","."]
code: def apply(self, *, x):
      if self.reduction == "concat":
          return tf.reshape(
              tensor=x, shape=(-1, self.output_spec().size)
          )
  
      elif self.reduction == "max":
          for _ in range(tf_util.rank(x=x) - 2):
              x = tf.reduce_max(input_tensor=x, axis=1)
          return x
  
      elif self.reduction == "mean":
          for _ in range(tf_util.rank(x=x) - 2):
              x = tf.reduce_mean(input_tensor=x, axis=1)
          return x
  
      elif self.reduction == "product":
          for _ in range(tf_util.rank(x=x) - 2):
              x = tf.reduce_prod(input_tensor=x, axis=1)
          return x
  
      elif self.reduction == "sum":
          for _ in range(tf_util.rank(x=x) - 2):
              x = tf.reduce_sum(input_tensor=x, axis=1)
          return x
  
imports: import numpy
  import tensorflow
  from tensorforce import TensorforceError
  from tensorforce.core import TensorSpec, tf_function, tf_util
  from tensorforce.core.layers import Layer
label_desc: Use image node_id 4 for calling the Pooling obj's underlying member method code with example usage: obj.apply() and returns: tf, x, x, x, x