code: def test_mil_default_value_to_proto(self):
      program_input_spec = [
          ct.TensorType(
              name="x",
              shape=[1],
              default_value=np.array([1.0]).astype(np.float32),
          ),
          ct.TensorType(name="y", shape=[1]),
      ]
      mlmodel = ct.convert(
          self.basic_network,
          convert_to="mlprogram",
          inputs=program_input_spec,
      )
      input_spec = mlmodel.get_spec().description.input
      assert (
          len(input_spec) == 2
      ), "2 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") == "multiArrayType"
      ), "Expected multiArrayType, got {}".format(
          input_spec[0].type.WhichOneof("Type")
      )
      assert (
          input_spec[0].type.multiArrayType.WhichOneof(
              "defaultOptionalValue"
          )
          == "floatDefaultValue"
      ), "Expected floatDefaultValue, got {} instead".format(
          input_spec[0].type.multiArrayType.WhichOneof(
              "defaultOptionalValue"
          )
      )
      assert input_spec[0].type.multiArrayType.floatDefaultValue == 1.0
  
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 2 for calling the TestMILDefaultValues obj's underlying member method code with example usage: obj.test_mil_default_value_to_proto() without return types