code: def compare_backend(
      proto,
      input_key_values,
      expected_outputs,
      use_cpu_only=False,
      atol=1e-04,
      rtol=1e-05,
      also_compare_shapes=True,
  ):
      """
      Inputs:
          - proto: MLModel proto.
  
          - input_key_values: str -> np.array. Keys must match those in
            input_placeholders.
  
          - expected_outputs: dict[str, np.array]. Required iff
            frontend_only == False
  
          - use_cpu_only: True/False.
      """
      if _IS_MACOS:
          pred = run_core_ml_predict(
              proto, input_key_values, use_cpu_only=use_cpu_only
          )
          if also_compare_shapes:
              compare_shapes(
                  proto,
                  input_key_values,
                  expected_outputs,
                  use_cpu_only=use_cpu_only,
                  pred=pred,
              )
          if not use_cpu_only:
              atol = min(atol * 100.0, 1e-1)
              rtol = min(rtol * 100.0, 1e-2)
          for o, expected in expected_outputs.items():
              msg = (
                  "Output {} differs. useCPUOnly={}.\nInput={}, "
                  + "Expected={}, Output={}\n"
              )
              assert is_close(
                  expected, pred[o], atol, rtol
              ), msg.format(
                  o, use_cpu_only, input_key_values, expected, pred[o]
              )
  
imports: import logging
  import numpy
  import copy
  import coremltools
  from coremltools import converters
  from coremltools.converters.mil import converter
  from coremltools.converters.mil.mil import Program, Function
  from coremltools.converters.mil.mil.passes.pass_registry import PASS_REGISTRY
  from coremltools._deps import _IS_MACOS
label_desc: Use image node_id 11 for calling a global function with example usage: compare_backend(proto, input_key_values, expected_outputs, use_cpu_only, atol, rtol, also_compare_shapes) without return types