code: def test_single_layer_example():
      batch_size, input_dim, output_dim = 2, 4, 2
  
      @mb.program(
          input_specs=[
              mb.TensorSpec(shape=(batch_size, input_dim)),
          ]
      )
      def prog(x):
          # Weight
          W_val = (
              np.array([0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9])
              .reshape(input_dim, output_dim)
              .T.astype(np.float32)
          )
          W = mb.const(val=W_val, name="const_W")
  
          # bias
          b_val = np.array([-0.5, 0.5]).astype(np.float32)
          b = mb.const(val=b_val, name="const_b")
  
          return mb.linear(x=x, weight=W, bias=b, name="lin")
  
      logger.info("prog:\n" + str(prog))
  
      mlmodel = ct.convert(
          prog, source="milinternal", convert_to="neuralnetwork"
      )
  
      feed_dict = {
          "x": np.random.rand(batch_size, input_dim).astype(np.float32),
      }
      assert mlmodel is not None
  
      if ct.utils._is_macos():
          prediction = mlmodel.predict(feed_dict)
          assert len(prediction) == 1
  
imports: import numpy
  import pytest
  import coremltools
  from coremltools import _logger
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Function, Program, types
  from coremltools.converters.mil.mil.passes.tests.test_passes import CONSTEXPR_FUNCS
label_desc: Use image node_id 1 for calling a global function with example usage: test_single_layer_example() and returns: mb