code: def setup_class(self):
      # define an mlprogram, which has weights
      @mb.program(input_specs=[mb.TensorSpec(shape=(4, 5000))])
      def linear_prog(input):
          W = mb.const(val=np.random.rand(100, 5000), name="const_W")
          out = mb.linear(x=input, weight=W, name="output")
          return out
  
      # define another mlprogram, which does not have weights
      @mb.program(input_specs=[mb.TensorSpec(shape=(4, 5, 2))])
      def relu_prog(input):
          out = mb.relu(x=input, name="output")
          return out
  
      # convert and save model on disk
      self.mlmodel = coremltools.convert(
          linear_prog, convert_to="mlprogram"
      )
      self.mlpackage_path = tempfile.mkdtemp(
          suffix=utils._MLPACKAGE_EXTENSION
      )
      self.mlmodel.save(self.mlpackage_path)
      self.mlmodel_no_weights = coremltools.convert(
          relu_prog, convert_to="mlprogram"
      )
  
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 1 for calling the TestSpecAndMLModelAPIs obj's underlying member method code with example usage: obj.setup_class() and returns: out, out