def count_parameters(model):
    """Counts the number of parameters in a model.

    Args:
        model (torch.model): Model to count parameters

    Returns:
        [int]: Count of all trainable parameters in the model
    """    
    return sum(p.numel() for p in model.parameters() if p.requires_grad)