code: def run_model_checkonly(
      model_file, model_name="", input_name="image"
  ):
      model = cm.models.MLModel(model_file)
      x = model_zoo.get_cat_image()
      shape_dict = {input_name: x.shape}
      # Some Relay passes change operators on the fly. Ensuring that we generate
      # new graph for each target.
      for target, dev in tvm.testing.enabled_targets():
          mod, params = relay.frontend.from_coreml(model, shape_dict)
          tvm_output = get_tvm_output(
              mod["main"], x, params, target, dev
          )
          print(
              target,
              dev,
              model_name,
              "prediction id: ",
              np.argmax(tvm_output.flat),
          )
  
imports: from os import path
  from enum import Enum
  import tempfile
  import numpy
  import model_zoo
  import coremltools
  from coremltools.models.neural_network import NeuralNetworkBuilder
  from coremltools.models import datatypes
  from tensorflow import keras
  import tvm
  import tvm.topi.testing
  import tvm.testing
  from tvm.contrib import graph_executor
  from tvm.topi.testing import conv2d_nchw_python
  from tvm import relay
label_desc: Use image node_id 2 for calling a global function with example usage: run_model_checkonly(model_file, model_name, input_name) without return types