def get_weights()

in grok/measure.py [0:0]


def get_weights(model):
    """
    Given a model, return a vector of weights.
    """
    x0 = None
    for p in model.parameters():
        if x0 is None:
            x0 = p.data.view(-1)
        else:
            x0 = torch.cat((x0, p.data.view(-1)))
    return x0.cpu().numpy()