[Profiler] Add `tag` property to `Result` (#81965)
With a bit of template deduction we can make the variant tell us what type it is, and then we don't have to rely on (and maintain) a bunch of `isinstance` checks in Python.
Differential Revision: [D38066829](https://our.internmc.facebook.com/intern/diff/D38066829/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81965
Approved by: https://github.com/davidchencsl