autograd/profiler: make python record_function use JIT methods
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/28264
Test Plan: buck test caffe2/test:autograd caffe2/test/cpp/jit:jit
Reviewed By: bddppq
Differential Revision: D17997612
fbshipit-source-id: 8a29ae50c28ce905f63c732fe0aa49edfc9d99e3