code: def test_pass_option_skip_const_by_size(self):
      model = self._get_test_model()
      example_input = torch.rand(1, 1, 28, 28)
      traced_model = torch.jit.trace(model, example_input)
  
      model_converted_without_pipeline = ct.convert(
          traced_model,
          inputs=[ct.TensorType(shape=example_input.shape)],
          convert_to="mlprogram",
      )
  
      pipeline = ct.PassPipeline()
      pipeline.set_options(
          "common::const_elimination", {"skip_const_by_size": "1e8"}
      )
      model_converted = ct.convert(
          traced_model,
          inputs=[ct.TensorType(shape=example_input.shape)],
          convert_to="mlprogram",
          pass_pipeline=pipeline,
      )
      # When the threshold is set to 1e8, no var is skipped in const elimination.
      assert get_op_types_in_program(
          model_converted._get_mil_internal(), skip_const_ops=False
      ).count("const") == get_op_types_in_program(
          model_converted_without_pipeline._get_mil_internal(),
          skip_const_ops=False,
      ).count(
          "const"
      )
  
      pipeline.set_options(
          "common::const_elimination", {"skip_const_by_size": "-1"}
      )
      model_converted = ct.convert(
          traced_model,
          inputs=[ct.TensorType(shape=example_input.shape)],
          convert_to="mlprogram",
          pass_pipeline=pipeline,
      )
      # When the threshold -1, almost all vars (except scalars) are skipped in const elimination.
      assert (
          get_op_types_in_program(
              model_converted._get_mil_internal(), skip_const_ops=False
          ).count("const")
          == 23
      )
  
imports: import copy
  import os
  import tempfile
  import numpy
  import pytest
  import coremltools
  from coremltools._deps import _HAS_TORCH
  from coremltools.converters.mil import Builder
  from coremltools.converters.mil.mil import Function, Program, get_new_symbol
  from coremltools.converters.mil.testing_utils import get_op_types_in_program
label_desc: Use image node_id 8 for calling the TestGraphPassManagement obj's underlying member method code with example usage: obj.test_pass_option_skip_const_by_size() without return types