code: def testBiasOnly_PreservesPretrainedWeights(self):
      i = tf.keras.layers.Input(shape=(2), name="input")
      output = tf.keras.layers.Dense(3, name="fc1")(i)
      model = tf.keras.Model(inputs=[i], outputs=[output])
  
      dense_layer_weights = model.layers[1].get_weights()
  
      algorithm = bias_only.BiasOnly()
      compressed_model = algorithm.compress_model(model)
  
      dense_layer_compressed_weights = compressed_model.layers[
          1
      ].get_weights()
  
      # kernel
      assert (
          dense_layer_weights[0] == dense_layer_compressed_weights[2]
      ).all()
  
      # bias
      algorithm.weight_reprs = []
      algorithm.init_training_weights(dense_layer_weights[1])
      w1_repr, w2_repr = algorithm.weight_reprs
  
      w1 = w1_repr.kwargs["initializer"](
          shape=None, dtype=w1_repr.kwargs["dtype"]
      )
      w2 = w2_repr.kwargs["initializer"](
          shape=None, dtype=w2_repr.kwargs["dtype"]
      )
  
      assert (w1 == dense_layer_compressed_weights[0]).numpy().all()
      assert (w2 == dense_layer_compressed_weights[1]).numpy().all()
  
file_path: model-optimization/tensorflow_model_optimization/python/core/common/keras/compression/algorithms/bias_only_test.py
imports: import os
  import tempfile
  import tensorflow
  from tensorflow_model_optimization.python.core.common.keras.compression.algorithms import bias_only
  from tensorflow_model_optimization.python.core.keras.testing import test_utils_mnist
label_desc: Use image node_id 5 for calling the FunctionalTest obj's underlying member method code with example usage: obj.testBiasOnly_PreservesPretrainedWeights() without return types