TrainingExtensions/tensorflow/src/python/aimet_tensorflow/keras/batch_norm_fold.py
def _delete_bn_from_model_subclassing(module_to_name_map: Dict[tf.keras.layers.Layer,
                                                               Tuple[tf.keras.Model, str]],
                                      bn_layer: tf.keras.layers.BatchNormalization):
    """
    Remove bn layer which is part of model subclassing api
    or model inheriting from tf.keras.layers.Layer

    :param module_to_name_map: model to remove bn from
    :param bn_layer: bn layer that should be removed
    """

    parent_ref, module_name = module_to_name_map[bn_layer]
    op = PassThroughOp()
    setattr(parent_ref, module_name, op)

    Remove bn layer which is part of model subclassing api
    or model inheriting from tf.keras.layers.Layer

    :param module_to_name_map: model to remove bn from
    :param bn_layer: bn layer that should be removed
    
Remove bn layer which is part of model subclassing api
or model inheriting from tf.keras.layers.Layer
Remove bn layer which is part of model subclassing api or model inheriting from tf . keras . layers . Layer
def _delete_bn_from_model_subclassing(module_to_name_map: Dict[tf.keras.layers.Layer,
                                                               Tuple[tf.keras.Model, str]],
                                      bn_layer: tf.keras.layers.BatchNormalization):
    parent_ref, module_name = module_to_name_map[bn_layer]
    op = PassThroughOp()
    setattr(parent_ref, module_name, op)
def _delete_bn_from_model_subclassing ( module_to_name_map : Dict [ tf . keras . layers . Layer , Tuple [ tf . keras . Model , str ] ] , bn_layer : tf . keras . layers . BatchNormalization ) : parent_ref , module_name = module_to_name_map [ bn_layer ] op = PassThroughOp ( ) setattr ( parent_ref , module_name , op )
Remove bn layer which is part of model subclassing api
or model inheriting from tf.keras.layers.Layer
Remove bn layer which is part of model subclassing api or model inheriting from tf . keras . layers . Layer
"""
    Remove bn layer which is part of model subclassing api
    or model inheriting from tf.keras.layers.Layer

    :param module_to_name_map: model to remove bn from
    :param bn_layer: bn layer that should be removed
    """
module_to_name_map
Dict[tf.keras.layers.Layer,
                                                               Tuple[tf.keras.Model, str]]
model to remove bn from
model to remove bn from
bn_layer
tf.keras.layers.BatchNormalization
bn layer that should be removed
bn layer that should be removed