code: def test_builder_to_backend_smoke(
      self, compute_unit, backend, num_dims
  ):
      kernel_sizes = [1, 2, 3]
      strides = [2, 1, 3]
  
      if num_dims == 1:
          x_val = np.array(
              [[[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0]]], dtype=np.float32
          )
          expected_output_types = [
              (1, 1, 4, types.fp32),
              (1, 1, 3, types.fp32),
          ]
          expected_outputs = [
              np.array([[[1.0, 3.0, 5.0, 7.0]]], dtype=np.float32),
              np.array(
                  [[[2.236068, 7.071068, 9.219544]]], dtype=np.float32
              ),
          ]
      elif num_dims == 2:
          x_val = np.array(
              [
                  [
                      [[-10.0, -6.0], [-7.0, 9.0]],
                      [[-3.0, 0.0], [11.0, 7.0]],
                  ]
              ],
              dtype=np.float32,
          )
          expected_output_types = [
              (1, 2, 1, 1, types.fp32),
              (1, 2, 2, 1, types.fp32),
          ]
          expected_outputs = [
              np.array([[[[11.66190338]], [[3.0]]]], dtype=np.float32),
              np.array(
                  [
                      [
                          [[16.309507], [11.401754]],
                          [[13.379088], [13.038404]],
                      ]
                  ],
                  dtype=np.float32,
              ),
          ]
      else:  # num_dims == 3
          pass  # Enum PoolingType3D has no value defined for name L2
  
      input_values = {"x": x_val}
      input_placeholders = {"x": mb.placeholder(shape=x_val.shape)}
  
      def build(x):
          return [
              mb.l2_pool(
                  x=x,
                  kernel_sizes=kernel_sizes[:num_dims],
                  strides=strides[:num_dims],
                  pad_type="valid",
              ),
              mb.l2_pool(
                  x=x,
                  kernel_sizes=kernel_sizes[-num_dims:],
                  strides=strides[-num_dims:],
                  pad_type="same",
              ),
          ]
  
      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 TestL2Pool obj's underlying member method code with example usage: obj.test_builder_to_backend_smoke(compute_unit, backend, num_dims) and returns: list