code: def pool_output_length(
      input_length, pool_size, stride, pad, ignore_border
  ):
      """
      Compute the output length of a pooling operator
      along a single dimension.
  
      Parameters
      ----------
      input_length : integer
          The length of the input in the pooling dimension
      pool_size : integer
          The length of the pooling region
      stride : integer
          The stride between successive pooling regions
      pad : integer
          The number of elements to be added to the input on each side.
      ignore_border: bool
          If ``True``, partial pooling regions will be ignored.
          Must be ``True`` if ``pad != 0``.
  
      Returns
      -------
      output_length
          * None if either input is None.
          * Computed length of the pooling operator otherwise.
  
      Notes
      -----
      When ``ignore_border == True``, this is given by the number of full
      pooling regions that fit in the padded input length,
      divided by the stride (rounding down).
  
      If ``ignore_border == False``, a single partial pooling region is
      appended if at least one input element would be left uncovered otherwise.
      """
      if input_length is None or pool_size is None:
          return None
  
      if ignore_border:
          output_length = input_length + 2 * pad - pool_size + 1
          output_length = (output_length + stride - 1) // stride
  
      # output length calculation taken from:
      # https://github.com/Theano/Theano/blob/master/theano/tensor/signal/downsample.py
      else:
          assert pad == 0
  
          if stride >= pool_size:
              output_length = (input_length + stride - 1) // stride
          else:
              output_length = (
                  max(
                      0,
                      (input_length - pool_size + stride - 1) // stride,
                  )
                  + 1
              )
  
      return output_length
  
imports: import theano.tensor
  from .base import Layer
  from ..utils import as_tuple
label_desc: Use image node_id 1 for calling a global function with example usage: pool_output_length(input_length, pool_size, stride, pad, ignore_border) and returns: output_length, None