code: def run_pooling_operators_benchmarks(
      ctx=mx.cpu(),
      dtype="float32",
      profiler="native",
      int64_tensor="off",
      warmup=25,
      runs=100,
  ):
      """Runs benchmarks with the given context, precision (dtype), and input data size (int64_tensor) for all the pooling
      operators in MXNet.
  
      Parameters
      ----------
      ctx: mx.ctx
          Context to run benchmarks
      dtype: str, default 'float32'
          Precision to use for benchmarks
      profiler: str, default 'native'
          Type of Profiler to use (native/python)
      int64_tensor: str, default 'off'
          Input tensor size to use for tests (if on, dimensions >= 2**32)
      warmup: int, default 25
          Number of times to run for warmup
      runs: int, default 100
          Number of runs to capture benchmark results
  
      Returns
      -------
      Dictionary of results. Key -> Name of the operator, Value -> Benchmark results.
  
      """
      pool_types = ["avg", "max", "sum"]
      global_pool_types = [0, 1]
  
      standard_data_list_pool1d = [(32, 3, 256), (32, 3, 64)]
      int64_tensor_data_list_pool1d = [(1, 1, 2**32)]
      standard_data_list_pool2d = [(32, 3, 256, 256), (32, 3, 64, 64)]
      int64_tensor_data_list_pool2d = [(2**28, 1, 4, 4)]
      standard_data_list_roipool = [(32, 3, 256, 256), (32, 3, 64, 64)]
      int64_tensor_data_list_roipool = [(32, 3, 2**13, 2**13)]
  
      if int64_tensor == "on":
          data_list_pool1d = int64_tensor_data_list_pool1d
          data_list_pool2d = int64_tensor_data_list_pool2d
          data_list_roipool = int64_tensor_data_list_roipool
      else:
          data_list_pool1d = standard_data_list_pool1d
          data_list_pool2d = standard_data_list_pool2d
          data_list_roipool = standard_data_list_roipool
  
      # Run 1D and 2D Pooling performance runs
      pool1d_benchmark_res = []
      pool2d_benchmark_res = []
      for pool_type in pool_types:
          for global_pool in global_pool_types:
              for pool1d_data in data_list_pool1d:
                  pool1d_benchmark_res += run_performance_test(
                      [getattr(MX_OP_MODULE, "Pooling")],
                      run_backward=True,
                      dtype=dtype,
                      ctx=ctx,
                      profiler=profiler,
                      inputs=[
                          {
                              "data": pool1d_data,
                              "kernel": 3,
                              "pool_type": pool_type,
                              "global_pool": global_pool,
                              "stride": 1,
                              "pad": 1,
                          }
                      ],
                      warmup=warmup,
                      runs=runs,
                  )
              for pool2d_data in data_list_pool2d:
                  pool2d_benchmark_res += run_performance_test(
                      [getattr(MX_OP_MODULE, "Pooling")],
                      run_backward=True,
                      dtype=dtype,
                      ctx=ctx,
                      profiler=profiler,
                      inputs=[
                          {
                              "data": pool2d_data,
                              "kernel": (3, 3),
                              "pool_type": pool_type,
                              "global_pool": global_pool,
                              "stride": (1, 1),
                              "pad": (0, 0),
                          }
                      ],
                      warmup=warmup,
                      runs=runs,
                  )
              # Run ROI Pooling performance runs
              roipool_benchmark_res = []
              for roipool_data in data_list_roipool:
                  roipool_benchmark_res += run_performance_test(
                      [getattr(MX_OP_MODULE, "ROIPooling")],
                      run_backward=True,
                      dtype=dtype,
                      ctx=ctx,
                      profiler=profiler,
                      inputs=[
                          {
                              "data": roipool_data,
                              "rois": (32, 5),
                              "pooled_size": (2, 2),
                              "spatial_scale": 0.5,
                          }
                      ],
                      warmup=warmup,
                      runs=runs,
                  )
      # Prepare combined results
      mx_pooling_op_results = merge_map_list(
          pool1d_benchmark_res
          + pool2d_benchmark_res
          + roipool_benchmark_res
      )
      return mx_pooling_op_results
  
imports: import mxnet
  from benchmark.opperf.utils.benchmark_utils import run_performance_test
  from benchmark.opperf.utils.common_utils import merge_map_list
  from benchmark.opperf.rules.default_params import MX_OP_MODULE
label_desc: Use image node_id 1 for calling a global function with example usage: run_pooling_operators_benchmarks(ctx, dtype, profiler, int64_tensor, warmup, runs) and returns: mx_pooling_op_results