code: def test_builder_to_backend_smoke(self, compute_unit, backend, mode):
      val = np.array(
          [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], dtype=np.float32
      )
      input_placeholders = {"x": mb.placeholder(shape=val.shape)}
      input_values = {"x": val}
  
      if mode in {"argmax", "argmin"}:
          expected_output_types = (2, types.int32)
      else:
          expected_output_types = (2, types.fp32)
  
      if mode == "argmax":
          build = lambda x: mb.reduce_argmax(
              x=x, axis=1, keep_dims=False
          )
          expected_outputs = np.array([2, 2], dtype=np.int32)
      elif mode == "argmin":
          build = lambda x: mb.reduce_argmin(
              x=x, axis=1, keep_dims=False
          )
          expected_outputs = np.array([0, 0], dtype=np.int32)
      elif mode == "l1_norm":
          build = lambda x: mb.reduce_l1_norm(
              x=x, axes=[1], keep_dims=False
          )
          expected_outputs = np.array([6.0, 15.0], dtype=np.float32)
      elif mode == "l2_norm":
          build = lambda x: mb.reduce_l2_norm(
              x=x, axes=[1], keep_dims=False
          )
          expected_outputs = np.array(
              [3.74165738, 8.77496438], dtype=np.float32
          )
      elif mode == "log_sum":
          build = lambda x: mb.reduce_log_sum(
              x=x, axes=[1], keep_dims=False
          )
          expected_outputs = np.array(
              [1.7917595, 2.70805025], dtype=np.float32
          )
      elif mode == "log_sum_exp":
          build = lambda x: mb.reduce_log_sum_exp(
              x=x, axes=[1], keep_dims=False
          )
          expected_outputs = np.array(
              [3.40760589, 6.40760612], dtype=np.float32
          )
      elif mode == "max":
          build = lambda x: mb.reduce_max(
              x=x, axes=[1], keep_dims=False
          )
          expected_outputs = np.array([3.0, 6.0], dtype=np.float32)
      elif mode == "mean":
          build = lambda x: mb.reduce_mean(
              x=x, axes=[1], keep_dims=False
          )
          expected_outputs = np.array([2.0, 5.0], dtype=np.float32)
      elif mode == "min":
          build = lambda x: mb.reduce_min(
              x=x, axes=[1], keep_dims=False
          )
          expected_outputs = np.array([1.0, 4.0], dtype=np.float32)
      elif mode == "prod":
          build = lambda x: mb.reduce_prod(
              x=x, axes=[1], keep_dims=False
          )
          expected_outputs = np.array([6.0, 120.0], dtype=np.float32)
      elif mode == "sum":
          build = lambda x: mb.reduce_sum(
              x=x, axes=[1], keep_dims=False
          )
          expected_outputs = np.array([6.0, 15.0], dtype=np.float32)
      elif mode == "sum_square":
          build = lambda x: mb.reduce_sum_square(
              x=x, axes=[1], keep_dims=False
          )
          expected_outputs = np.array([14.0, 77.0], dtype=np.float32)
      else:
          raise NotImplementedError()
  
      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_reduction.py
imports: import itertools
  import numpy
  import pytest
  import scipy
  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
  from coremltools.converters.mil.testing_utils import random_gen, ssa_fn
label_desc: Use image node_id 1 for calling the TestReduction obj's underlying member method code with example usage: obj.test_builder_to_backend_smoke(compute_unit, backend, mode) without return types