code: def convert_to_mlmodel(
      model_spec,
      tensor_inputs,
      backend=("neuralnetwork", "fp32"),
      converter_input_type=None,
      compute_unit=ct.ComputeUnit.CPU_ONLY,
      minimum_deployment_target=None,
  ):
      def _convert_to_inputtype(inputs):
          if isinstance(inputs, list):
              return [_convert_to_inputtype(x) for x in inputs]
          elif isinstance(inputs, tuple):
              return tuple([_convert_to_inputtype(x) for x in inputs])
          elif isinstance(inputs, TensorType):
              return inputs
          elif isinstance(inputs, torch.Tensor):
              return TensorType(
                  shape=inputs.shape,
                  dtype=torch_to_mil_types[inputs.dtype],
              )
          else:
              raise ValueError(
                  "Unable to parse type {} into InputType.".format(
                      type(inputs)
                  )
              )
  
      if converter_input_type is None:
          inputs = list(_convert_to_inputtype(tensor_inputs))
      else:
          inputs = converter_input_type
  
      if _HAS_EXECUTORCH and isinstance(model_spec, ExportedProgram):
          inputs = None
          outputs = None
  
      return ct_convert(
          model_spec,
          inputs=inputs,
          convert_to=backend,
          source="pytorch",
          compute_units=compute_unit,
          minimum_deployment_target=minimum_deployment_target,
      )
  
imports: import numpy
  import pytest
  import torch
  import torch.nn
  import coremltools
  import coremltools.models.utils
  from coremltools import RangeDim, TensorType
  from coremltools._deps import _HAS_EXECUTORCH, _HAS_TORCH_EXPORT_API, _IS_MACOS
  from coremltools.converters.mil.mil.types.type_mapping import nptype_from_builtin
  from coremltools.converters.mil.testing_utils import ct_convert, validate_minimum_deployment_target
  from ..ops import TorchFrontend
  from ..torchscript_utils import torch_to_mil_types
label_desc: Use image node_id 5 for calling a global function with example usage: convert_to_mlmodel(model_spec, tensor_inputs, backend, converter_input_type, compute_unit, minimum_deployment_target) and returns: ct_convert, unknown, tuple, inputs, TensorType