[dynamo] Register einops functions lazily (#110575)
Fixes #110549
We currently have a circular import between dynamo and einops as described in the issue.
This works around the issue by adding a mechanism to register initialization callbacks
that are called the first time an object is seen from that particular module.
This means that dynamo will only import `einops` after it's already fully initialized
and being called in a function being traced.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/110575
Approved by: https://github.com/jansel
ghstack dependencies: #110990