[quant][be] Add a check in prepare_qat to make sure the model is in training mode (#69879)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69879
att
Test Plan:
```
python test/test_quantization.py TestQuantizationAwareTraining
```
Imported from OSS
Reviewed By: vkuzo
Differential Revision: D33080989
fbshipit-source-id: 55a631284365ec9dfd6bd7469688490ab1891d41