Fix HistogramObserver to not do detach on input (#34114)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/33545, added a unittest
Pull Request resolved: https://github.com/pytorch/pytorch/pull/34114
Differential Revision: D20224719
Pulled By: dzhulgakov
fbshipit-source-id: 053d3b3b0c86340027ba1b95b5f3c247aa151aee