import torch


def all_params(model: torch.nn.Module) -> torch.Tensor:
    """ Returns an array of all model parameters, given either from a Module or a state_dict """
    return torch.cat([x.detach().view(-1) for n, x in model.state_dict().items() if n != "word_embeddings.position_ids"])