class_docstr: prog: Program
  
  # NN always implicitly cast return types to fp32. Detect any return
  # types that are not builtin.fp32 and alert user of the implicit
  # casting. This pass must be at the end. Example:
  #
  # Given:
  #
  #    main(%x: (2, 3, fp32)) {
  #      block0() {
  #        %shape_0: (2,i32)* = const(val=[4, 7])
  #      } -> (%shape_0)
  #    }
  #
  # (Notice that %shape_0 is i32, not fp32)
  #
  # Result:
  #
  # The same program.
  #
  # Alert messages about %shape_0 being implicitly cast from i32 to fp32.
  #
  # Comment: This pass should do more proper casting as backend supports more types.
code: def apply(self, prog):
      for f_name, f in prog.functions.items():
          for v in f.outputs:
              if isinstance(v, Var) and v.dtype != types.fp32:
                  msg = (
                      "Output var {} of type {} in function {} is "
                      + "cast to type fp32"
                  )
                  logger.warning(
                      msg.format(
                          v.name,
                          types.builtin_to_string(v.dtype),
                          f_name,
                      )
                  )
  
imports: from coremltools import _logger
  from coremltools.converters.mil.mil import Var, types
  from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
label_desc: Use image node_id 1 for calling the alert_return_type_cast obj's underlying member method code with example usage: obj.apply(prog) without return types