[QAT] Check the value of numel to avoid segfault (#81547)
Fixes #78123
### Original Result
Segmentation fault
### Result after fix
RuntimeError: numel is out of the bound of input tensor
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81547
Approved by: https://github.com/kit1980