import torch.nn.init as init
#inside the main class where the Convolution, Linear Layers and BatchNorm are defined
for m in self.modules():
            if isinstance(m,nn.Conv2d) or isinstance(m,nn.Linear):
                in_v,_ = init._calculate_fan_in_and_fan_out() #what should be tensor that goes in here
                X = torch.randn(m.weight.data.size())*torch.sqrt(2/in_v)
                values = torch.Tensor(X.rvs(m.weight.data.numel()))
                values = values.view(m.weight.data.size())
                m.weight.data.copy_(values)
            elif isinstance(m,nn.BatchNorm2d):
                m.weight.data.fill_(1)
                m.bias.data.zero_()

What should be feed inside the init._calculate_fan_in_and_fan_out()?
Is this code correct?