code: def test_pool2d(run_module):
      def get_graph(
          op,
          x_shape=(1, 3, 32, 32),
          pool_size=(2, 2),
          strides=(2, 2),
          padding=(0, 0),
          ceil_mode=False,
          count_include_pad=None,
      ):
          x = relay.var("x", shape=(x_shape), dtype="float32")
          if count_include_pad is not None:
              out = op(
                  x,
                  pool_size=pool_size,
                  strides=strides,
                  padding=padding,
                  ceil_mode=ceil_mode,
                  count_include_pad=count_include_pad,
              )
          else:
              out = op(
                  x,
                  pool_size=pool_size,
                  strides=strides,
                  padding=padding,
                  ceil_mode=ceil_mode,
              )
          f = relay.Function([x], out)
          return f, {"x": x_shape}, []
  
      for pool_size in [(2, 2), (3, 3)]:
          for strides in [(1, 1), (2, 2)]:
              for padding in [(0, 0), (1, 1), (0, 0, 1, 1)]:
                  for ceil_mode in [False, True]:
                      # Skip "the padding size is larger than or equal to the filter size for exclusive-counting pooling"
                      if pool_size == (2, 2) and padding == (
                          0,
                          0,
                          1,
                          1,
                      ):
                          continue
                      for count_include_pad in [False, True]:
                          # Skip "inclusive-counted blended or average pooling is not supported in combination with asymmetric padding"
                          if count_include_pad and (
                              padding == (0, 0, 1, 1)
                              or strides == (2, 2)
                          ):
                              continue
                          run_and_verify_func(
                              get_graph(
                                  relay.nn.avg_pool2d,
                                  pool_size=pool_size,
                                  strides=strides,
                                  padding=padding,
                                  ceil_mode=ceil_mode,
                                  count_include_pad=count_include_pad,
                              ),
                              run_module=run_module,
                          )
                      run_and_verify_func(
                          get_graph(
                              relay.nn.max_pool2d,
                              pool_size=pool_size,
                              strides=strides,
                              padding=padding,
                              ceil_mode=ceil_mode,
                          ),
                          run_module=run_module,
                      )
  
imports: import itertools
  import logging
  from typing import Tuple
  import numpy
  import pytest
  import tvm
  import tvm.relay.testing
  import tvm.testing
  from tvm import relay
  from tvm.contrib.download import download
  from tvm.relay import Any, GlobalVar
  from tvm.relay.expr_functor import ExprVisitor
  from tvm.relay.op.contrib import tensorrt
label_desc: Use image node_id 17 for calling a global function with example usage: test_pool2d(run_module) and returns: f,  dict,  list