In your posted code snippet you’ve initialized it as:
shape_parameters_estimated = torch.zeros([batch, stat8model.variance.size], dtype=torch.float32, device=device, requires_grad=True)

Could you post a minimal, executable code snippet to reproduce the issue, please?