docstr: save an mlprogram model with no weights, using the save SPI and an empty weights directory.
  Reload the model from disk and verify it works
docstr_tok: ["save","an","mlprogram","model","with","no","weights",",","using","the","save","SPI","and","an","empty","weights","directory",".","Reload","the","model","from","disk","and","verify","it","works"]
code: def test_save_spec_api_model_with_no_weights(self):
      """
      save an mlprogram model with no weights, using the save SPI and an empty weights directory.
      Reload the model from disk and verify it works
      """
      spec = self.mlmodel_no_weights.get_spec()
      with tempfile.TemporaryDirectory(
          suffix=utils._MLPACKAGE_EXTENSION
      ) as model_path:
          with tempfile.TemporaryDirectory() as empty_weight_dir:
              utils.save_spec(
                  spec, model_path, weights_dir=empty_weight_dir
              )
              model = MLModel(model_path)
              self._test_mlmodel_correctness(model)
  
imports: import os
  import shutil
  import tempfile
  import numpy
  import pytest
  import coremltools
  from coremltools import ComputeUnit, utils
  from coremltools._deps import _HAS_TORCH
  from coremltools.converters.mil import Builder
  from coremltools.libmodelpackage import ModelPackage
  from coremltools.models import MLModel
  from coremltools.models.utils import _MLPACKAGE_AUTHOR_NAME, _WEIGHTS_DIR_NAME
  from coremltools.proto import Model_pb2
label_desc: Use image node_id 9 for calling the TestSpecAndMLModelAPIs obj's underlying member method code with example usage: obj.test_save_spec_api_model_with_no_weights() without return types