Fix scriptability for Observer (#25219)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25219
Ensure that observer code remains scriptable after addition of warnings
ghstack-source-id: 89055664
Test Plan: buck test caffe2/test:quantization -- 'test_observer_scriptable \(test_quantization\.ObserverTest\)' --print-passing-details
Differential Revision: D17065218
fbshipit-source-id: b3599613b4835bf1c5241aff191b40ba5f40d7be