Add anomaly mode for C++ (#46981)
Summary:
This adds anomaly mode for C++.
The backtrace isn't perfect yet, but it's a start.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/46981
Reviewed By: IvanKobzarev
Differential Revision: D24631957
Pulled By: albanD
fbshipit-source-id: 4b91e205e7e51f4cf0fbc651da5013a00a3b2497