TrainingExtensions/torch/src/python/aimet_torch/cross_layer_equalization.py
def equalize_model(model: torch.nn.Module, input_shapes: Union[Tuple, List[Tuple]]):
    """
    High-level API to perform Cross-Layer Equalization (CLE) on the given model. The model is equalized in place.

    :param model: Model to equalize
    :param input_shapes: Shape of the input (can be a tuple or a list of tuples if multiple inputs)
    :return: None
    """

    device = get_device(model)
    model.cpu()

    # fold batchnorm layers
    folded_pairs = fold_all_batch_norms(model, input_shapes)
    equalize_bn_folded_model(model, input_shapes, folded_pairs)

    model.to(device=device)

    High-level API to perform Cross-Layer Equalization (CLE) on the given model. The model is equalized in place.

    :param model: Model to equalize
    :param input_shapes: Shape of the input (can be a tuple or a list of tuples if multiple inputs)
    :return: None
    
High-level API to perform Cross-Layer Equalization (CLE) on the given model. The model is equalized in place.
High - level API to perform Cross - Layer Equalization ( CLE ) on the given model . The model is equalized in place .
def equalize_model(model: torch.nn.Module, input_shapes: Union[Tuple, List[Tuple]]):
    device = get_device(model)
    model.cpu()
    folded_pairs = fold_all_batch_norms(model, input_shapes)
    equalize_bn_folded_model(model, input_shapes, folded_pairs)
    model.to(device=device)
def equalize_model ( model : torch . nn . Module , input_shapes : Union [ Tuple , List [ Tuple ] ] ) : device = get_device ( model ) model . cpu ( ) folded_pairs = fold_all_batch_norms ( model , input_shapes ) equalize_bn_folded_model ( model , input_shapes , folded_pairs ) model . to ( device = device )
High-level API to perform Cross-Layer Equalization (CLE) on the given model.
High - level API to perform Cross - Layer Equalization ( CLE ) on the given model .
"""
    High-level API to perform Cross-Layer Equalization (CLE) on the given model. The model is equalized in place.

    :param model: Model to equalize
    :param input_shapes: Shape of the input (can be a tuple or a list of tuples if multiple inputs)
    :return: None
    """ # fold batchnorm layers
None
model
torch.nn.Module
Model to equalize
Model to equalize
input_shapes
Union[Tuple, List[Tuple]]
Shape of the input (can be a tuple or a list of tuples if multiple inputs)
Shape of the input ( can be a tuple or a list of tuples if multiple inputs )