Make warnings be UserWarnings with source file info (#21231)
Summary:
Redo of #15201, this makes `warnings.warn` calls match their Python
behavior
](https://our.intern.facebook.com/intern/diff/15605266/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21231
Pulled By: driazati
Differential Revision: D15605266
fbshipit-source-id: 5931fd720b0c40d52dd492fbd1f5a76abefaab5c