code: def _compute_shape(self, input_shape):
      if self.data_format == DataFormat.channels_first:
          input_shape = [
              input_shape[0],
              input_shape[2],
              input_shape[3],
              input_shape[1],
          ]
  
      shape_to_return = [None]  # num channels unchanged
      for dim_inp_len, dim_kern_width, dim_stride in zip(
          input_shape[1:3], self.pool_size, self.strides
      ):
          if self.padding != PaddingMode.valid:
              # assuming that overhangs are excluded
              shape_to_return.append(
                  1 + int((dim_inp_len - dim_kern_width) / dim_stride)
              )
          elif self.padding != PaddingMode.same:
              shape_to_return.append(
                  int((dim_inp_len + dim_stride - 1) / dim_stride)
              )
          else:
              raise RuntimeError(
                  "Please implement shape inference for"
                  " padding mode: " + str(self.padding)
              )
      shape_to_return.append(input_shape[-1])
  
      if self.data_format == DataFormat.channels_first:
          input_shape = [
              input_shape[0],
              input_shape[3],
              input_shape[1],
              input_shape[2],
          ]
  
      return shape_to_return
  
imports: from __future__ import division
  from __future__ import print_function
  from __future__ import absolute_import
  from .core import *
  from .helper_functions import conv1d_transpose_via_conv2d
  from .convolutional import PaddingMode, DataFormat
  from .None import helper_functions
  import tensorflow
  from tensorflow.python.ops import nn_grad
label_desc: Use image node_id 2 for calling the Pool2D obj's underlying member method code with example usage: obj._compute_shape(input_shape) and returns: shape_to_return