class_docstr: Resample feature map for downsampling or upsampling.
docstr: Pool the inputs to target height and width.
docstr_tok: ["Pool","the","inputs","to","target","height","and","width","."]
code: def _pool2d(self, inputs, height, width, target_height, target_width):
      """Pool the inputs to target height and width."""
      height_stride_size = int((height - 1) // target_height + 1)
      width_stride_size = int((width - 1) // target_width + 1)
      if self.pooling_type == "max":
          return tf.keras.layers.MaxPooling2D(
              pool_size=[height_stride_size + 1, width_stride_size + 1],
              strides=[height_stride_size, width_stride_size],
              padding="SAME",
              data_format=self.data_format,
          )(inputs)
      if self.pooling_type == "avg":
          return tf.keras.layers.AveragePooling2D(
              pool_size=[height_stride_size + 1, width_stride_size + 1],
              strides=[height_stride_size, width_stride_size],
              padding="SAME",
              data_format=self.data_format,
          )(inputs)
      raise ValueError(
          "Unsupported pooling type {}.".format(self.pooling_type)
      )
  
imports: import functools
  from absl import logging
  import numpy
  import tensorflow
  import utils
  from .None import fpn_configs
label_desc: Use image node_id 2 for calling the ResampleFeatureMap obj's underlying member method code with example usage: obj._pool2d(inputs, height, width, target_height, target_width) and returns: tf, tf