code: def test_mil_ranged_image_with_default(self):
      input_shape = [
          ct.ImageType(
              name="x",
              shape=(1, 3, 10, ct.RangeDim(10, 30, default=20)),
          )
      ]
      mlmodel = ct.convert(
          self.basic_network,
          source="milinternal",
          convert_to="mlprogram",
          inputs=input_shape,
      )
      input_spec = mlmodel.get_spec().description.input
      assert (
          len(input_spec) == 1
      ), "1 input expected, got {} instead".format(len(input_spec))
      assert (
          input_spec[0].name == "x"
      ), "input name in MLModel is {}, 'x' is expected".format(
          input_spec[0].name
      )
      assert (
          input_spec[0].type.WhichOneof("Type") == "imageType"
      ), "Expected imageType, got {}".format(
          input_spec[0].type.WhichOneof("Type")
      )
      assert (
          input_spec[0].type.imageType.WhichOneof("SizeFlexibility")
          == "imageSizeRange"
      ), "Expected imageSizeRange in ShapeFlexibility"
  
      spec_H = input_spec[0].type.imageType.height
      spec_W = input_spec[0].type.imageType.width
      assert (
          spec_H == 10 and spec_W == 20
      ), "expected [H, W] == [10, 20], got [{}, {}] instead".format(
          spec_H, spec_W
      )
  
      spec_H_range = [
          input_spec[
              0
          ].type.imageType.imageSizeRange.heightRange.lowerBound,
          input_spec[
              0
          ].type.imageType.imageSizeRange.heightRange.upperBound,
      ]
      spec_W_range = [
          input_spec[
              0
          ].type.imageType.imageSizeRange.widthRange.lowerBound,
          input_spec[
              0
          ].type.imageType.imageSizeRange.widthRange.upperBound,
      ]
      assert spec_H_range == [10, 10], "Ranged height mismatch"
      assert spec_W_range == [10, 30], "Ranged width mismatch"
  
file_path: coremltools/coremltools/converters/mil/backend/mil/test_model_input_params.py
imports: import numpy
  import coremltools
  from coremltools.converters.mil.mil.builder import Builder
  from coremltools.converters.mil.mil.program import Symbol
  from coremltools.models.utils import _macos_version
label_desc: Use image node_id 9 for calling the TestMILFlexibleShapes obj's underlying member method code with example usage: obj.test_mil_ranged_image_with_default() without return types