def weights_to_bytes(weights):
    """ Serialize the model parameters into a bytes.
    
        args: 
            - weights: list of numpy array
        
        returns: 
            list of bytes representing layer's weights
    """
    serialized_weights = [p.numpy().tobytes() for p in weights]
    return serialized_weights