TrainingExtensions/tensorflow/src/python/aimet_tensorflow/keras/batch_norm_fold.py
def _get_ordered_conv_linears(node_layer_map: Dict,
                              layer_out_node_map: Dict) -> List[Union[CONV_TYPE, LINEAR_TYPE]]:
    """
    helper to select a list of conv_linears in the order of occurence

    :param node_layer_map: dictionary includes node_ref as a key, in_layers and out_layer as value
    :param layer_out_node_map: dictionary includes layer_ref as a key, outbound nodes as value
    :return: return List of conv/linear layer refs
    """
    # get ordered layers list in node_layer map dictionary
    list_of_ordered_layers = _get_ordered_layers(node_layer_map, layer_out_node_map)

    # look for conv layers
    ordered_conv_linears = []
    for layer in list_of_ordered_layers:
        if isinstance(layer, (tf.keras.layers.Conv2D, tf.keras.layers.Dense)):
            ordered_conv_linears.append(layer)
    return ordered_conv_linears

    helper to select a list of conv_linears in the order of occurence

    :param node_layer_map: dictionary includes node_ref as a key, in_layers and out_layer as value
    :param layer_out_node_map: dictionary includes layer_ref as a key, outbound nodes as value
    :return: return List of conv/linear layer refs
    
helper to select a list of conv_linears in the order of occurence
helper to select a list of conv_linears in the order of occurence
def _get_ordered_conv_linears(node_layer_map: Dict,
                              layer_out_node_map: Dict) -> List[Union[CONV_TYPE, LINEAR_TYPE]]:
    list_of_ordered_layers = _get_ordered_layers(node_layer_map, layer_out_node_map)
    ordered_conv_linears = []
    for layer in list_of_ordered_layers:
        if isinstance(layer, (tf.keras.layers.Conv2D, tf.keras.layers.Dense)):
            ordered_conv_linears.append(layer)
    return ordered_conv_linears
def _get_ordered_conv_linears ( node_layer_map : Dict , layer_out_node_map : Dict ) -> List [ Union [ CONV_TYPE , LINEAR_TYPE ] ] : list_of_ordered_layers = _get_ordered_layers ( node_layer_map , layer_out_node_map ) ordered_conv_linears = [ ] for layer in list_of_ordered_layers : if isinstance ( layer , ( tf . keras . layers . Conv2D , tf . keras . layers . Dense ) ) : ordered_conv_linears . append ( layer ) return ordered_conv_linears
helper to select a list of conv_linears in the order of occurence
helper to select a list of conv_linears in the order of occurence
"""
    helper to select a list of conv_linears in the order of occurence

    :param node_layer_map: dictionary includes node_ref as a key, in_layers and out_layer as value
    :param layer_out_node_map: dictionary includes layer_ref as a key, outbound nodes as value
    :return: return List of conv/linear layer refs
    """ # get ordered layers list in node_layer map dictionary # look for conv layers
return List of conv/linear layer refs
return List of conv / linear layer refs
node_layer_map
Dict
dictionary includes node_ref as a key, in_layers and out_layer as value
dictionary includes node_ref as a key in_layers and out_layer as value
layer_out_node_map
Dict
dictionary includes layer_ref as a key, outbound nodes as value
dictionary includes layer_ref as a key outbound nodes as value