code: def test_linear_quanitzation_stress(mode, dtype):
      (
          model,
          inputs,
          torch_input_values,
          coreml_input_values,
      ) = get_test_model_and_data()
      torchmodel = torch.jit.trace(model, torch_input_values)
      mlmodel = ct.convert(
          torchmodel, inputs=inputs, convert_to="mlprogram"
      )
  
      mlmodel_quantized = linear_quantize_weights(
          mlmodel, mode=mode, dtype=dtype
      )
  
      # validate parameters
      expected_ops = [
          "constexpr_affine_dequantize",
          "cast",
          "conv",
          "cast",
      ]
      assert (
          get_op_types_in_program(mlmodel_quantized._mil_program)
          == expected_ops
      )
  
      quanitze_op = mlmodel_quantized._mil_program.functions[
          "main"
      ].find_ops(op_type="constexpr_affine_dequantize")[0]
      assert (
          model.weight.detach().numpy().shape
          == quanitze_op.quantized_data.shape
      )
  
      verify_model_outputs(
          mlmodel, mlmodel_quantized, coreml_input_values
      )
  
imports: import itertools
  import numpy
  import pytest
  import torch
  import coremltools
  import coremltools.optimize
  from coremltools._deps import _HAS_SKLEARN
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.testing_utils import get_op_types_in_program
  from coremltools.optimize.coreml._post_training_quantization import CoreMLWeightMetaData
  from coremltools.test.ml_program.test_compression import get_test_model_and_data
label_desc: Use image node_id 2 for calling the TestLinearQuantizeWeights obj's underlying member method code with example usage: obj.test_linear_quanitzation_stress(mode, dtype) without return types