code: def test_avgpool_builder_to_backend_smoke_samelower_padtype(
      self, compute_unit, backend, inputshape_kernelshape
  ):
      input_shape, kernel_shape = inputshape_kernelshape
      rank = len(input_shape) - 2
  
      if backend.backend == "neuralnetwork" and rank == 3:
          pytest.skip(
              "pad_type `same_lower` not supported for 3d pooling in neuralnetwork backend"
          )
      if backend.backend == "mlprogram" and rank == 1:
          pytest.xfail(
              "rdar://98852008 (MIL backend producing wrong result for 1d pooling with pad_type "
              "same_lower)"
          )
      if backend.opset_version == ct.target.iOS15:
          pytest.skip(
              "same_lower pad_type not supported in iOS15 opset."
          )
  
      x_val = (
          np.arange(1, np.prod(input_shape) + 1)
          .reshape(*input_shape)
          .astype(np.float32)
      )
  
      if rank == 1:
          expected_output_val = [0.5, 1.5]
      elif rank == 2:
          expected_output_val = [0.25, 0.75, 1, 2.5]
      else:
          expected_output_val = [
              0.125,
              0.375,
              0.5,
              1.25,
              0.75,
              1.75,
              2,
              4.5,
          ]
  
      expected_output_types = [input_shape + (types.fp32,)]
      expected_outputs = [
          np.array(expected_output_val)
          .reshape(*input_shape)
          .astype(np.float32)
      ]
      input_values = {"x": x_val}
      input_placeholders = {"x": mb.placeholder(shape=x_val.shape)}
  
      def build(x):
          return mb.avg_pool(
              x=x,
              kernel_sizes=kernel_shape,
              pad_type="same_lower",
          )
  
      run_compare_builder(
          build,
          input_placeholders,
          input_values,
          expected_output_types,
          expected_outputs,
          compute_unit=compute_unit,
          backend=backend,
      )
  
file_path: coremltools/coremltools/converters/mil/mil/ops/tests/iOS14/test_pool.py
imports: import itertools
  import numpy
  import pytest
  import coremltools
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import get_new_symbol, types
  from coremltools.converters.mil.mil.ops.tests.iOS14 import backends
  from coremltools.converters.mil.mil.ops.tests.testing_utils import run_compare_builder
  from coremltools.converters.mil.testing_reqs import compute_units
label_desc: Use image node_id 2 for calling the TestAvgPool obj's underlying member method code with example usage: obj.test_avgpool_builder_to_backend_smoke_samelower_padtype(compute_unit, backend, inputshape_kernelshape) and returns: mb