class_docstr: 2-dimensional pooling layer (local pooling) (specification key: `pool2d`).
  
  Args:
      reduction ('average' | 'max'): Pooling type
          (<span style="color:#C00000"><b>required</b></span>).
      window (int > 0 | (int > 0, int > 0)): Window size
          (<span style="color:#00C000"><b>default</b></span>: 2).
      stride (int > 0 | (int > 0, 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: ["2-dimensional","pooling","layer","(","local","pooling",")","(","specification","key",":","`","pool2d","`",")",".","Args",":","reduction","(","'average","'","|","'max","'",")",":","Pooling","type","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","window","(","int",">","0","|","(","int",">","0",",","int",">","0",")",")",":","Window","size","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","2",")",".","stride","(","int",">","0","|","(","int",">","0",",","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 output_spec(self):
      output_spec = super().output_spec()
  
      if self.padding == "same":
          output_spec.shape = (
              np.ceil(output_spec.shape[0] / self.stride[1]),
              np.ceil(output_spec.shape[1] / self.stride[2]),
              output_spec.shape[2],
          )
      elif self.padding == "valid":
          output_spec.shape = (
              np.ceil(
                  (output_spec.shape[0] - (self.window[1] - 1))
                  / self.stride[1]
              ),
              np.ceil(
                  (output_spec.shape[1] - (self.window[2] - 1))
                  / self.stride[2]
              ),
              output_spec.shape[2],
          )
  
      return output_spec
  
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 3 for calling the Pool2d obj's underlying member method code with example usage: obj.output_spec() and returns: output_spec