code: def test_reduces_model_size_at_reasonable_accuracy(self):
      algorithm = self.get_algorithm()
      model = build_model()
      training_model = algorithm.get_training_model(model)
      train_model(training_model)
      compressed_model = algorithm.compress_model(training_model)
      original_model_dir = self.save_model(model)
      compressed_model_dir = self.save_model(compressed_model)
  
      with self.subTest("training_model_has_reasonable_accuracy"):
          accuracy = evaluate_model(training_model)
          self.assertGreater(accuracy, 0.9)
  
      with self.subTest("compressed_weights_are_smaller"):
          original_size = sum(
              map(get_weight_size_in_bytes, model.weights)
          ).numpy()
          compressed_size = sum(
              map(get_weight_size_in_bytes, compressed_model.weights)
          ).numpy()
          self.assertLess(compressed_size, 0.01 * original_size)
  
      with self.subTest("zip_compressed_model_is_smaller"):
          original_zipfile = zip_directory(original_model_dir)
          compressed_zipfile = zip_directory(compressed_model_dir)
          original_size = os.path.getsize(original_zipfile)
          compressed_size = os.path.getsize(compressed_zipfile)
          # TODO(jballe): There is a lot of overhead in the saved function graphs
          # (saved_model.pb), which is especially severe for small models like this
          # one. The function graph is several times larger than the weights. Can we
          # save some space by only saving the function graph of the main call(),
          # rather than of each layer?
          self.assertLess(compressed_size, 0.2 * original_size)
  
      with self.subTest("compressed_model_has_reasonable_accuracy"):
          compressed_model = tf.keras.models.load_model(
              compressed_model_dir
          )
          accuracy = evaluate_model(compressed_model)
          self.assertGreater(accuracy, 0.9)
  
imports: import os
  import shutil
  from absl.testing import parameterized
  import tensorflow
  from tensorflow_model_optimization.python.core.common.keras.compression.algorithms import epr
label_desc: Use image node_id 8 for calling the EPRTest obj's underlying member method code with example usage: obj.test_reduces_model_size_at_reasonable_accuracy() without return types