code: def test_builder_to_backend_global_pool_3d(
      self, compute_unit, backend, mode
  ):
      # test lowering to spatial reduction to global_pool path
      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}
  
      expected_output_types = (1, 1, 1, 1, 1, types.fp32)
  
      if mode == "max":
          build = lambda x: mb.reduce_max(
              x=x, axes=[2, -1, 3], keep_dims=True
          )
          expected_outputs = np.array([[[[[6.0]]]]], dtype=np.float32)
      elif mode == "mean":
          build = lambda x: mb.reduce_mean(
              x=x, axes=[-3, 3, 4], keep_dims=True
          )
          expected_outputs = np.array([[[[[3.5]]]]], dtype=np.float32)
  
      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 4 for calling the TestReduction obj's underlying member method code with example usage: obj.test_builder_to_backend_global_pool_3d(compute_unit, backend, mode) without return types