graph mode: util for fusion of functions which require observation (#39413)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39413
Implementing the request from
https://github.com/pytorch/pytorch/pull/39095
WIP so we can align on the API, once it looks good
will amend the PR to apply to all relevant functions.
Test Plan:
```
python test/test_quantization.py TestQuantizeScriptPTSQOps.test_hardswish
```
Imported from OSS
Differential Revision: D21885263
fbshipit-source-id: 029339a99f8c50e45dd1dfb7fd89c20e3188720d