The expected standard deviation of Xavier initialization of a D-dimensional tensor would be $1 / \sqrt (D)$ but it is not as below. Please help understand why.
import torch
D = 27
x = torch.zeros(1, D)
torch.nn.init.xavier_normal_(x)
torch.std(x, dim=-1)
-----
tensor([0.2820])
Expected std
1 / np.sqrt(D)
---
0.1925
1/sqrt(D)
. Please elaborate. $\endgroup$