I am trying to use xavier_uniform_ initialization for batch and layer normalization layers however I am receiving a valueerror: Fan in and fan out can not be computed for tensor with less than 2 dimensions. Is there anyway I can rectify this problem?
Also when I try to initialize my bias layers using:
for key, value in network.state_dict().items():
    if 'bias' in key:
        network.state_dict()[key] = torch.full_like(network.state_dict()[key], 0, requires_grad=True)
        # or
        network.state_dict()[key] = torch.full_like(network.state_dict()[key], 0)

When I go to print the state_dict after I initialized all the weights and biases, the biases still turn up to be random numbers instead of 0. Am I using the wrong function or reassigning the wrong variable? How can I fix this?