class_docstr: Converts all dtypes to types that are supported by the Core ML runtime.
  The runtime supports fp16, fp32, int16, uint16, int32, str, and bool variables.
  
  General rules:
      * Integer vars with unsupported types are replaced with int32 types.
      * All other types not in the list of runtime supported types are replaced with the fp32 dtype.
        No casts are inserted; the previous type is replaced. The assumption is that all remaining
        types are numerical and can be reasonably replaced with 32 bit float types.
  
  The "main" function has additional rules since its I/O is mapped to Core ML model I/O:
      * if function.opset_version <  coremltools.target.iOS16, then:
          * Fp16 I/O is replaced with fp32 I/O.
              Casts (fp32 input -> fp16) are inserted at the beginning of the program to preserve 16 bit inputs.
              Casts (fp16 -> fp32 output) are inserted at the end of the program to preserve 16 bit computations.
  
      * All non-integer I/O that is not fp32 is replaced with fp32 I/O.
        A cast (prev input type -> fp32) is inserted at the beginning of the program to preserve non-fp32 inputs.
        A cast (prev type -> fp32 out) is inserted at the end of the program to preserve non-fp32 computations.
        The assumption is that all remaining types are numerical and it is valid to cast them to/from fp32.
  
      * The only exception: Int64 outputs are allowed for the classifier op. This is to keep consistency with
        the Core ML API, which uses 64 bit integers to represent classifier labels.
  
  ------
  
  func main(bool x, int32 y, fp32 z) {
      bool  out = logical_not(x)
  } -> (out, y, z)
  
  becomes
  
  func main(fp32 x, int32 y, fp32 z) {
     bool  x_casted = cast(x)
     bool  out__pre__output__fp32__cast = logical_not(x_casted)
     fp32  out = cast(out__pre__output__fp32__cast)
  } -> (out, y, z)
  
  ------
  
  func not_main(bool x, int32 y, fp32 z) {
      bool  out = logical_not(x)
  } -> (out, y, z)
  
  is unchanged.
class_docstr_tok: ["Converts","all","dtypes","to","types","that","are","supported","by","the","Core","ML","runtime",".","The","runtime","supports","fp16",",","fp32",",","int16",",","uint16",",","int32",",","str",",","and","bool","variables",".","General","rules",":","*","Integer","vars","with","unsupported","types","are","replaced","with","int32","types",".","*","All","other","types","not","in","the","list","of","runtime","supported","types","are","replaced","with","the","fp32","dtype",".","No","casts","are","inserted",";","the","previous","type","is","replaced",".","The","assumption","is","that","all","remaining","types","are","numerical","and","can","be","reasonably","replaced","with","32","bit","float","types",".","The","``","main","''","function","has","additional","rules","since","its","I\/O","is","mapped","to","Core","ML","model","I\/O",":","*","if","function.opset_version","<","coremltools.target.iOS16",",","then",":","*","Fp16","I\/O","is","replaced","with","fp32","I\/O",".","Casts","(","fp32","input","-",">","fp16",")","are","inserted","at","the","beginning","of","the","program","to","preserve","16","bit","inputs",".","Casts","(","fp16","-",">","fp32","output",")","are","inserted","at","the","end","of","the","program","to","preserve","16","bit","computations",".","*","All","non-integer","I\/O","that","is","not","fp32","is","replaced","with","fp32","I\/O",".","A","cast","(","prev","input","type","-",">","fp32",")","is","inserted","at","the","beginning","of","the","program","to","preserve","non-fp32","inputs",".","A","cast","(","prev","type","-",">","fp32","out",")","is","inserted","at","the","end","of","the","program","to","preserve","non-fp32","computations",".","The","assumption","is","that","all","remaining","types","are","numerical","and","it","is","valid","to","cast","them","to\/from","fp32",".","*","The","only","exception",":","Int64","outputs","are","allowed","for","the","classifier","op",".","This","is","to","keep","consistency","with","the","Core","ML","API",",","which","uses","64","bit","integers","to","represent","classifier","labels",".","--","--","--","func","main","(","bool","x",",","int32","y",",","fp32","z",")","{","bool","out","=","logical_not","(","x",")","}","-",">","(","out",",","y",",","z",")","becomes","func","main","(","fp32","x",",","int32","y",",","fp32","z",")","{","bool","x_casted","=","cast","(","x",")","bool","out__pre__output__fp32__cast","=","logical_not","(","x_casted",")","fp32","out","=","cast","(","out__pre__output__fp32__cast",")","}","-",">","(","out",",","y",",","z",")","--","--","--","func","not_main","(","bool","x",",","int32","y",",","fp32","z",")","{","bool","out","=","logical_not","(","x",")","}","-",">","(","out",",","y",",","z",")","is","unchanged","."]
code: def apply(self, prog):
      for name, func in prog.functions.items():
          is_main_funtion = name == "main"
          _adjust_io_to_supported_types(func, is_main_funtion)
  
file_path: coremltools/coremltools/converters/mil/backend/mil/passes/adjust_io_to_supported_types.py
imports: from typing import Set
  from coremltools import _logger
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
  from coremltools.converters.mil.mil.passes.helper import block_context_manager
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
label_desc: Use image node_id 1 for calling the adjust_io_to_supported_types obj's underlying member method code with example usage: obj.apply(prog) without return types