[BE] Use f-string in various Python functions (#44161)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/44161
Reviewed By: seemethere
Differential Revision: D23515874
Pulled By: malfet
fbshipit-source-id: 868cf65aedd58fce943c08f8e079e84e0a36df1f