code: def _map_to_inference_weights(
      training_weights, algorithm, training_tensors
  ):
      """Construct the inference weight values from the weights after training.
  
        The weight values have the same structure as the output of
        `tf.keras.layers.Layer.get_weights`.
  
      Args:
        training_weights: layer's weights from training, retrieved via
          layer.get_weights()
        algorithm: weight compression algorithm
        training_tensors: map from compressible weight attribute (e.g. 'kernel') to
          relevant tensors.
  
      Returns:
        Initial weight values for training.
  
      Example:
        training_weights =    [kernel_var1, kernel_var2, bias]
        training_tensors = {'kernel': [kernel_var1, kernel_var2]}
        expected output:   [compress_training_weights(
          [kernel_var1, kernel_var2]), bias]
      """
  
      compressed_weights = []
      weights = ["kernel", "bias"]
      layer_weights_i = 0
      for weight in weights:
          if weight in training_tensors:
              compressed = algorithm.compress_training_weights(
                  *training_tensors[weight]
              )
              for c in compressed:
                  compressed_weights.append(c.numpy())
              layer_weights_i += len(training_tensors[weight])
          else:
              compressed_weights.append(
                  training_weights[layer_weights_i]
              )
              layer_weights_i += 1
      return compressed_weights
  
imports: from typing import List, Mapping
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: _map_to_inference_weights(training_weights, algorithm, training_tensors) and returns: compressed_weights