[Shape Fns] Fix optional None for the actual shape functions (#83092)
I think the person who edited `mean.dim` edited the python and the associated Torchscript version manually in two different ways. This diff fixes that all up. It also fixes the inconsistencies in the `torch.nonzero` generated file
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83092
Approved by: https://github.com/eellison