Lazy deprecation import function in torch.nn (#83834)
This introduces a mechanism to show a deprecation warning on import.
This is achieved through override of the `__getattr__` in the modules
that need the migration. See https://peps.python.org/pep-0562/ for
details.
Some of the codes under torch.nn are migrating, and will require
a deprecation warning on import. Specifically, quantized modules are
in the process of migration to the `torch.ao` package
(see https://github.com/pytorch/pytorch/issues/81667).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83834
Approved by: https://github.com/albanD