code: def noop_elimination(prog):
      """
      We remove reshape/slice/split if it's a no-op
  
      Given:
          %1 (1, 96, 128, 64, fp32) = ...
          %2 (1, 96, 128, 64, fp32) = reshape(%1)
          ...
          %3 (1, 96, 128, 64, fp32) = add(%2, constant)
          ...
  
      Result:
          %1 (1, 96, 128, 64, fp32) = ...
          %3 (1, 96, 128, 64, fp32) = add(%1, constant)
          ...
  
      """
      for f_name, f in prog.functions.items():
          block_changed = True
          while block_changed:
              block_changed = noop_elimination_block(f)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/passes/noop_elimination.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
  from coremltools.converters.mil.mil import Builder
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: noop_elimination(prog) without return types