import torch


def get_number_parameters(model: torch.nn.Module) -> int:
    """
    counts the number of trainable parameters in the given model.
    :param model: torch model.
    :return: number of parameters.
    """
    return sum([p.data.nelement() for p in model.parameters()])