code: def verify_model_outputs(model, compressed_model, input_values):
      """
      This utility functions does the following checks:
  
      (1) Verify the output of the compressed model has the same shape / type of the original model
      (2) The decompressed and compressed model have the same numerical outputs
      """
  
      # Make sure the model can be decompressed
      decompressed_model = decompress_weights(compressed_model)
  
      # Validate the output shape / type
      ref_outputs = model._mil_program.functions["main"].outputs
      outputs = compressed_model._mil_program.functions["main"].outputs
  
      assert len(ref_outputs) == len(outputs)
  
      for a, b in zip(ref_outputs, outputs):
          assert a.name == b.name
          assert a.shape == a.shape
          assert a.dtype == b.dtype
  
      if ct.utils._macos_version() < (13, 0):
          return
  
      # Validate that the compressed model could be decompressed, and produces correct outputs
      output_dict = compressed_model.predict(input_values)
      de_output_dict = decompressed_model.predict(input_values)
      for k, v in de_output_dict.items():
          assert k in output_dict
          np.testing.assert_allclose(v, output_dict[k])
  
imports: import itertools
  import numpy
  import pytest
  import torch
  import coremltools
  import coremltools.optimize
  from coremltools._deps import _HAS_SKLEARN
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.testing_utils import get_op_types_in_program
  from coremltools.optimize.coreml._post_training_quantization import CoreMLWeightMetaData
  from coremltools.test.ml_program.test_compression import get_test_model_and_data
label_desc: Use image node_id 8 for calling a global function with example usage: verify_model_outputs(model, compressed_model, input_values) without return types