[Usability] Handle repeated jit.script calls on function gracefully (#51545)
Summary:
Repeated calls on `class` is not handled since `class`'s compilation process will change soon in https://github.com/pytorch/pytorch/issues/44324
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51545
Reviewed By: H-Huang
Differential Revision: D26207010
Pulled By: gmagogsfm
fbshipit-source-id: 5f3f64b0e4b4ab4dbf5c9411d9c143472922a106