import torch


def get_gradient_vector(model, pass_param_name=('nu', 'alpha','beta')):
    """
    Get 1 dimensional gradient vector of the given model.
    
    Args:
        model(torch.nn.Module)
        pass_param_name(Sequence[Str]): Exclude non-shared parameters. 
    Return:
        torch.FloatTensor - the gradients of weights for the given model
    """
    tensors = []
    for n, w in model.named_parameters():
        if not len(set.intersection(set(n.split('.')),set(pass_param_name))) > 0:
            tensors.append(w.grad.flatten())
        
    grad = torch.cat(tensors)
    return grad