[te] Don't throw when re-registering a CodeGen factory (#49174)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/49174
We've seen this happening when libtorch is loaded repeatedly on macOS. Tbh I'm not sure I understand why this happens; why do we re-construct these static objects but re-use the static registry itself? But it's fairly straightforward to just overwrite the factory method and no harm in doing so.
ghstack-source-id: 118306581
Test Plan: compile
Reviewed By: ZolotukhinM
Differential Revision: D25466642
fbshipit-source-id: 4c456a57407f23fa0c9f4e74975ed1186e790c74