[fx] Refactor Tracer so that find_module and root args creation could be overridden by implementations (#46493)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/46493
This will allow us to override tow following methods of Tracer:
-- get_module_qualified_name: to find qualified name of a module. In default implementation, it looks for module in registered modules and from there it gets to the name, but in some scenarios, the module being called could not be the exact same module that was registered.
-- create_args_for_root: This allows to create and pass custom structured input (like dictionary with specific keys) to the main module, rather than pure proxy objects. This will also allows us to let proxy objects only represent tensors when they are passed to modules.
ghstack-source-id: 114609258
Test Plan: Unit tests passed
Reviewed By: zdevito, bradleyhd
Differential Revision: D24269034
fbshipit-source-id: d7b67f2349dd516b6f7678e41601d6899403d9de