TrainingExtensions/tensorflow/src/python/aimet_tensorflow/keras/utils/common.py
def _update_model_output_info(residing_model: tf.keras.Model, replaced_layer: tf.keras.layers.Layer,
                              new_tensor_output: tf.Tensor):
    """
    Update model output layers, output coordinates, and nested outputs with the new output tensor.
    :param residing_model: Model to update output info for
    :param replaced_layer: Layer that was replaced
    :param new_tensor_output: New output tensor for the model
    """
    # pylint: disable=protected-access
    # Last layer in new_layers will be a new output op
    old_layer_index = residing_model._output_layers.index(replaced_layer)
    del residing_model._output_layers[old_layer_index]
    del residing_model._output_coordinates[old_layer_index]
    if isinstance(residing_model.output, list):
        del residing_model._nested_outputs[old_layer_index]
    else:
        assert old_layer_index == 0

    layer, node_index, tensor_index = new_tensor_output._keras_history  # pylint: disable=protected-access
    residing_model._output_layers.append(layer)
    residing_model._output_coordinates.append((layer, node_index, tensor_index))
    if isinstance(residing_model._nested_outputs, list):
        residing_model._nested_outputs.append(new_tensor_output)
    else:
        residing_model._nested_outputs = new_tensor_output

    Update model output layers, output coordinates, and nested outputs with the new output tensor.
    :param residing_model: Model to update output info for
    :param replaced_layer: Layer that was replaced
    :param new_tensor_output: New output tensor for the model
    
Update model output layers, output coordinates, and nested outputs with the new output tensor.
Update model output layers output coordinates and nested outputs with the new output tensor .
def _update_model_output_info(residing_model: tf.keras.Model, replaced_layer: tf.keras.layers.Layer,
                              new_tensor_output: tf.Tensor):
    old_layer_index = residing_model._output_layers.index(replaced_layer)
    del residing_model._output_layers[old_layer_index]
    del residing_model._output_coordinates[old_layer_index]
    if isinstance(residing_model.output, list):
        del residing_model._nested_outputs[old_layer_index]
    else:
        assert old_layer_index == 0
    layer, node_index, tensor_index = new_tensor_output._keras_history  
    residing_model._output_layers.append(layer)
    residing_model._output_coordinates.append((layer, node_index, tensor_index))
    if isinstance(residing_model._nested_outputs, list):
        residing_model._nested_outputs.append(new_tensor_output)
    else:
        residing_model._nested_outputs = new_tensor_output
def _update_model_output_info ( residing_model : tf . keras . Model , replaced_layer : tf . keras . layers . Layer , new_tensor_output : tf . Tensor ) : old_layer_index = residing_model . _output_layers . index ( replaced_layer ) del residing_model . _output_layers [ old_layer_index ] del residing_model . _output_coordinates [ old_layer_index ] if isinstance ( residing_model . output , list ) : del residing_model . _nested_outputs [ old_layer_index ] else : assert old_layer_index == 0 layer , node_index , tensor_index = new_tensor_output . _keras_history residing_model . _output_layers . append ( layer ) residing_model . _output_coordinates . append ( ( layer , node_index , tensor_index ) ) if isinstance ( residing_model . _nested_outputs , list ) : residing_model . _nested_outputs . append ( new_tensor_output ) else : residing_model . _nested_outputs = new_tensor_output
Update model output layers, output coordinates, and nested outputs with the new output tensor.
Update model output layers output coordinates and nested outputs with the new output tensor .
"""
    Update model output layers, output coordinates, and nested outputs with the new output tensor.
    :param residing_model: Model to update output info for
    :param replaced_layer: Layer that was replaced
    :param new_tensor_output: New output tensor for the model
    """ # pylint: disable=protected-access # Last layer in new_layers will be a new output op # pylint: disable=protected-access
residing_model
tf.keras.Model
Model to update output info for
Model to update output info for
replaced_layer
tf.keras.layers.Layer
Layer that was replaced
Layer that was replaced
new_tensor_output
tf.Tensor
New output tensor for the model
New output tensor for the model