def count_parameters(model) -> int:
    """Count parameters in a torch model.

    Parameters
    ----------
    model : torch.nn.module
        The model from which you want to count parameters.

    Returns
    -------
    int
        Total number of parameters in the model.
    """
    return sum(p.numel() for p in model.parameters() if p.requires_grad)