I’m sorry but I’ve got no time to test the following idea, that I think it could work:

Concatenate the model parameters n times (i.e. repeat)
v = torch.cat((v0, v1, …, vn)).view(1, -1)
Use this: https://github.com/LeviViana/torchessian/blob/master/torchessian/__init__.py#L6-L27


Even if it works, I’m not sure though that it would provide any performance gains.