def _flatten_tensors(tensors: Sequence[torch.Tensor]) -> torch.Tensor:
    """
    Unwraps a list of parameters gradients

    # Returns

    `torch.Tensor`
        A tensor of shape `(x,)` where `x` is the total number of entires in the gradients.
    """
    views = []
    for p in tensors:
        if p.data.is_sparse:
            view = p.data.to_dense().view(-1)
        else:
            view = p.data.view(-1)
        views.append(view)
    return torch.cat(views, 0)
Unwraps a list of parameters gradients

# Returns

`torch.Tensor`
A tensor of shape `(x,)` where `x` is the total number of entires in the gradients.
allennlp/interpret/influence_interpreters/simple_influence.py