Revert "Revert "[Profiler] Move python tracing to unified event type (Part 2)""
This reverts commit 4305f8e9bda34f18eb7aacab51c63651cfc61802.
replace TEST_CUDA with torch.has_cuda
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79173
Approved by: https://github.com/ezyang