code: def build_linear_keras_subclassed_model(
      input_shape, weights, dynamic=False
  ):
      del input_shape
  
      class CustomLinearModel(tf.keras.Model):
          def __init__(self, weights, name=None, dynamic=False):
              super(CustomLinearModel, self).__init__(
                  name=name, dynamic=dynamic
              )
              self.init_weights = weights
              self.init_dynamic = dynamic
              self.dense = tf.keras.layers.Dense(
                  weights.shape[-1],
                  use_bias=False,
                  name="dense",
                  kernel_initializer=tf.keras.initializers.Constant(
                      weights
                  ),
              )
  
          def call(self, inputs):
              return self.dense(inputs["feature"])
  
          def get_config(self):
              return {
                  "name": self.name,
                  "weights": self.init_weights,
                  "dynamic": self.init_dynamic,
              }
  
      return CustomLinearModel(weights, dynamic=dynamic)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import os
  from absl.testing import parameterized
  import neural_structured_learning.configs
  from neural_structured_learning.keras import adversarial_regularization
  import numpy
  import tensorflow
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 4 for calling a global function with example usage: build_linear_keras_subclassed_model(input_shape, weights, dynamic) and returns: CustomLinearModel, self, dict