TrainingExtensions/tensorflow/src/python/aimet_tensorflow/keras/batch_norm_fold.py
def _find_possible_convs_linears_bn(node_layer_map: Dict, layer_out_node_map: Dict)\
        -> Dict[Union[CONV_TYPE, LINEAR_TYPE], List[Union[None, BN_TYPE]]]:
    """
    find all possible convs_linears_bn by traversing all paths in the model considering all inputs

    :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 dictionary of all possible conv_bn pairs,
        key: Dense or Conv layer & Value: list of BNS;
        first index in this list shows bn_in and the second index shows bn_out
    """

    input_layers = common.find_input_layers(node_layer_map)
    visited_layer = set()
    conv_linear_with_bn_dict = {}

    for input_layer in input_layers:
        _fill_conv_linear_bn_dict(input_layer, node_layer_map, layer_out_node_map,
                                  [None, None, None], visited_layer, conv_linear_with_bn_dict)

    return conv_linear_with_bn_dict

    find all possible convs_linears_bn by traversing all paths in the model considering all inputs

    :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 dictionary of all possible conv_bn pairs,
        key: Dense or Conv layer & Value: list of BNS;
        first index in this list shows bn_in and the second index shows bn_out
    
find all possible convs_linears_bn by traversing all paths in the model considering all inputs
find all possible convs_linears_bn by traversing all paths in the model considering all inputs
def _find_possible_convs_linears_bn(node_layer_map: Dict, layer_out_node_map: Dict)\
        -> Dict[Union[CONV_TYPE, LINEAR_TYPE], List[Union[None, BN_TYPE]]]:
    input_layers = common.find_input_layers(node_layer_map)
    visited_layer = set()
    conv_linear_with_bn_dict = {}
    for input_layer in input_layers:
        _fill_conv_linear_bn_dict(input_layer, node_layer_map, layer_out_node_map,
                                  [None, None, None], visited_layer, conv_linear_with_bn_dict)
    return conv_linear_with_bn_dict
def _find_possible_convs_linears_bn ( node_layer_map : Dict , layer_out_node_map : Dict ) -> Dict [ Union [ CONV_TYPE , LINEAR_TYPE ] , List [ Union [ None , BN_TYPE ] ] ] : input_layers = common . find_input_layers ( node_layer_map ) visited_layer = set ( ) conv_linear_with_bn_dict = { } for input_layer in input_layers : _fill_conv_linear_bn_dict ( input_layer , node_layer_map , layer_out_node_map , [ None , None , None ] , visited_layer , conv_linear_with_bn_dict ) return conv_linear_with_bn_dict
find all possible convs_linears_bn by traversing all paths in the model considering all inputs
find all possible convs_linears_bn by traversing all paths in the model considering all inputs
"""
    find all possible convs_linears_bn by traversing all paths in the model considering all inputs

    :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 dictionary of all possible conv_bn pairs,
        key: Dense or Conv layer & Value: list of BNS;
        first index in this list shows bn_in and the second index shows bn_out
    """
return dictionary of all possible conv_bn pairs,
key: Dense or Conv layer & Value: list of BNS;
first index in this list shows bn_in and the second index shows bn_out
return dictionary of all possible conv_bn pairs key : Dense or Conv layer & Value : list of BNS ; first index in this list shows bn_in and the second index shows bn_out
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