Here is the pseudocode:
- $v \sim MultiVariateGaussian(\mu,\sigma I)$
- $v = \frac{v}{ \| v \| }$
In pytorch:
v = MultivariateNormal(torch.zeros(10000), torch.eye(10000))
v = v/v.norm(2)
I don't understand this well enough but I've been told by whuber that:
v = torch.normal(torch.zeros(10000), torch.eye(10000))
v = v/v.norm(2)
is also correct i.e. sampling from a univariate normal for each coordinate.