TrainingExtensions/tensorflow/src/python/aimet_tensorflow/keras/batch_norm_fold.py
def _delete_all_bns_from_model(model: (tf.keras.Model, tf.keras.layers.Layer),
                               bn_layers: List[tf.keras.layers.BatchNormalization]):
    """
    Remove all bn layers

    :param model
    :param bn_layers: bn layers that should be removed
    """

    module_to_name_map = common.module_to_name_map(model)

    for bn_layer in bn_layers:
        if bn_layer in module_to_name_map:
            _delete_bn_from_model_subclassing(module_to_name_map, bn_layer)
        else:
            _delete_bn_for_non_subclassed_model(model, bn_layer)

    Remove all bn layers

    :param model
    :param bn_layers: bn layers that should be removed
    
Remove all bn layers
:param model
:param bn_layers: bn layers that should be removed
Remove all bn layers : param model : param bn_layers : bn layers that should be removed
def _delete_all_bns_from_model(model: (tf.keras.Model, tf.keras.layers.Layer),
                               bn_layers: List[tf.keras.layers.BatchNormalization]):
    module_to_name_map = common.module_to_name_map(model)
    for bn_layer in bn_layers:
        if bn_layer in module_to_name_map:
            _delete_bn_from_model_subclassing(module_to_name_map, bn_layer)
        else:
            _delete_bn_for_non_subclassed_model(model, bn_layer)
def _delete_all_bns_from_model ( model : ( tf . keras . Model , tf . keras . layers . Layer ) , bn_layers : List [ tf . keras . layers . BatchNormalization ] ) : module_to_name_map = common . module_to_name_map ( model ) for bn_layer in bn_layers : if bn_layer in module_to_name_map : _delete_bn_from_model_subclassing ( module_to_name_map , bn_layer ) else : _delete_bn_for_non_subclassed_model ( model , bn_layer )
Remove all bn layers
:param model
:param bn_layers: bn layers that should be removed
Remove all bn layers : param model : param bn_layers : bn layers that should be removed
"""
    Remove all bn layers

    :param model
    :param bn_layers: bn layers that should be removed
    """
model
(tf.keras.Model, tf.keras.layers.Layer)
bn_layers
List[tf.keras.layers.BatchNormalization]