code: def test_const_elimination():
      @mb.program(input_specs=[mb.TensorSpec(shape=(2, 4))])
      def prog(x):
          a = np.random.rand(2, 4).astype(np.float32)
          double_a = mb.add(x=a, y=a)
          return mb.add(x=x, y=double_a)
  
      assert_op_count_match(prog, expect=2, op="const")
      prev_prog = copy.deepcopy(prog)
      PASS_REGISTRY["common::const_elimination"](prog)
      assert_same_output_names(prev_prog, prog)
      assert_op_count_match(prog, expect=3, op="const")
  
      if validate_model:
          assert_model_is_valid(prog, {"x": (2, 4)})
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/passes/test_passes.py
imports: from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.testing_utils import assert_op_count_match, assert_model_is_valid, assert_same_output_names, get_op_types_in_program, apply_pass_and_basic_check
  from coremltools.converters.mil.mil import Symbol, types
  from coremltools.converters.mil.mil.passes.pass_registry import PASS_REGISTRY
  import copy
  import pytest
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: test_const_elimination() and returns: mb