code: def _set_dtypes(
      input_dict,  # type: Dict[Text, np._ArrayLike[Any]]
      model,  # type: MLModel
  ):
      # type: (...) -> None
      spec = model.get_spec()
      for input_ in spec.description.input:
          if (
              input_.type.HasField("multiArrayType")
              and input_.name in input_dict
          ):
              if (
                  input_.type.multiArrayType.dataType
                  == ft.ArrayFeatureType.INT32
              ):
                  input_dict[input_.name] = input_dict[
                      input_.name
                  ].astype(np.int32)
              if (
                  input_.type.multiArrayType.dataType
                  == ft.ArrayFeatureType.FLOAT32
              ):
                  input_dict[input_.name] = input_dict[
                      input_.name
                  ].astype(np.float32)
              if (
                  input_.type.multiArrayType.dataType
                  == ft.ArrayFeatureType.DOUBLE
              ):
                  input_dict[input_.name] = input_dict[
                      input_.name
                  ].astype(np.float64)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/onnx/_backend_rep.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from typing import Any, Sequence, List
  from onnx.backend.base import BackendRep, namedtupledict
  from onnx.mapping import TENSOR_TYPE_TO_NP_TYPE
  from coremltools.proto import FeatureTypes_pb2
  from coremltools.models import MLModel
  from typing import Dict, Any, Text, Tuple
  from onnx import TensorProto
  from ._graph import EdgeInfo
  from ._converter import SupportedVersion
label_desc: Use image node_id 1 for calling a global function with example usage: _set_dtypes(input_dict, model) without return types