class_docstr: 1-dimensional pooling layer (local pooling) (specification key: `pool1d`).
  
  Args:
      reduction ('average' | 'max'): Pooling type
          (<span style="color:#C00000"><b>required</b></span>).
      window (int > 0): Window size
          (<span style="color:#00C000"><b>default</b></span>: 2).
      stride (int > 0): Stride size
          (<span style="color:#00C000"><b>default</b></span>: 2).
      padding ('same' | 'valid'): Padding type, see
          `TensorFlow docs <https://www.tensorflow.org/api_docs/python/tf/nn/convolution>`__
          (<span style="color:#00C000"><b>default</b></span>: 'same').
      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: ["1-dimensional","pooling","layer","(","local","pooling",")","(","specification","key",":","`","pool1d","`",")",".","Args",":","reduction","(","'average","'","|","'max","'",")",":","Pooling","type","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","window","(","int",">","0",")",":","Window","size","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","2",")",".","stride","(","int",">","0",")",":","Stride","size","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","2",")",".","padding","(","'same","'","|","'valid","'",")",":","Padding","type",",","see","`","TensorFlow","docs","<","https",":","\/\/www.tensorflow.org\/api_docs\/python\/tf\/nn\/convolution",">","`","__","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","'same","'",")",".","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):
      x = tf.expand_dims(input=x, axis=1)
  
      if self.reduction == "average":
          x = tf.nn.avg_pool(
              input=x,
              ksize=self.window,
              strides=self.stride,
              padding=self.padding.upper(),
          )
  
      elif self.reduction == "max":
          x = tf.nn.max_pool(
              input=x,
              ksize=self.window,
              strides=self.stride,
              padding=self.padding.upper(),
          )
  
      x = tf.squeeze(input=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 Pool1d obj's underlying member method code with example usage: obj.apply() and returns: x