code: def const_elimination(prog):
      """
      prog: Program
  
      # Replace non-const ops that have const Var
      # outputs replaced with const op. Example:
      #
      # Given:
      #   %2, %3 = non_const_op(...)  # %2 is const, %3 isn't const
      #   %4 = other_op(%2, %3)
      #
      # Result:
      #   _, %3 = non_const_op(...)  # _ is the ignored output
      #   %2_const = const(mode=m)  # %2_const name is for illustration only
      #   %4 = other_op(%2_const, %3)
      #
      # where m is 'file_value' / 'immediate_value' depending on heuristics
      # in get_const_mode.
      """
      for f_name, f in prog.functions.items():
          const_elimination_block(f)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/passes/const_elimination.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import numpy
  import six
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
label_desc: Use image node_id 3 for calling a global function with example usage: const_elimination(prog) without return types