TrainingExtensions/tensorflow/src/python/aimet_tensorflow/keras/utils/common.py
def _find_last_layers(cur_layer: (tf.keras.Model, tf.keras.layers.Layer)) \
        -> typing.List[tf.keras.layers.Layer]:
    """
    helper to find the last layers of the model.

    :param cur_layer: model to obtain last layers
    :return: return list of last layers in the model
    """

    last_layers = []
    # pylint: disable=protected-access
    for inner_layer in cur_layer._layers:
        if inner_layer.outbound_nodes == []:
            if inner_layer.submodules:
                last_layers.extend(_find_last_layers(inner_layer))
            else:
                last_layers.append(inner_layer)

    return last_layers

    helper to find the last layers of the model.

    :param cur_layer: model to obtain last layers
    :return: return list of last layers in the model
    
helper to find the last layers of the model.
helper to find the last layers of the model .
def _find_last_layers(cur_layer: (tf.keras.Model, tf.keras.layers.Layer)) \
        -> typing.List[tf.keras.layers.Layer]:
    last_layers = []
    for inner_layer in cur_layer._layers:
        if inner_layer.outbound_nodes == []:
            if inner_layer.submodules:
                last_layers.extend(_find_last_layers(inner_layer))
            else:
                last_layers.append(inner_layer)
    return last_layers
def _find_last_layers ( cur_layer : ( tf . keras . Model , tf . keras . layers . Layer ) ) -> typing . List [ tf . keras . layers . Layer ] : last_layers = [ ] for inner_layer in cur_layer . _layers : if inner_layer . outbound_nodes == [ ] : if inner_layer . submodules : last_layers . extend ( _find_last_layers ( inner_layer ) ) else : last_layers . append ( inner_layer ) return last_layers
helper to find the last layers of the model.
helper to find the last layers of the model .
"""
    helper to find the last layers of the model.

    :param cur_layer: model to obtain last layers
    :return: return list of last layers in the model
    """ # pylint: disable=protected-access
return list of last layers in the model
return list of last layers in the model
cur_layer
(tf.keras.Model, tf.keras.layers.Layer)
model to obtain last layers
model to obtain last layers