code: def testSVD_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 = svd.SVD(rank=1)
      model_for_inference = algorithm.compress_model(model)
  
      dense_layer_compressed_weights = model_for_inference.layers[
          1
      ].get_weights()
  
      # kernel
      w1, w2 = algorithm.compress_training_weights(
          tf.constant(dense_layer_weights[0])
      )
      assert (w1 == dense_layer_compressed_weights[0]).numpy().all()
      assert (w2 == dense_layer_compressed_weights[1]).numpy().all()
  
      # bias
      assert (
          dense_layer_weights[1] == dense_layer_compressed_weights[2]
      ).all()
  
file_path: model-optimization/tensorflow_model_optimization/python/core/common/keras/compression/algorithms/different_training_and_inference_test.py
imports: import os
  import tempfile
  import tensorflow
  from tensorflow_model_optimization.python.core.common.keras.compression.algorithms import different_training_and_inference
  from tensorflow_model_optimization.python.core.keras.testing import test_utils_mnist
label_desc: Use image node_id 6 for calling the FunctionalTest obj's underlying member method code with example usage: obj.testSVD_PreservesPretrainedWeights() without return types