implement `XLAHooks` and register it to PyTorch when loaded.
This PR adds XLAHooks that override the placeholder implementation added https://github.com/pytorch/pytorch/pull/161369.
only part of the methods are implemented. I believe not all the methods are actually needed. therefore, i only implemented the most basic ones. People can implement the other methods when they need.
IT DOSEN'T BUILD, BUT FEEL FREE TO REVIEW! This PR depends on https://github.com/pytorch/pytorch/pull/161369 and https://github.com/pytorch/xla/pull/9682. This PR won't build before the two PR submitted.
See https://github.com/pytorch/xla/blob/master/.github/ci.md#temporarily-pinning-pytorch-pr-in-pytorchxla-pr
Just a heads up: you are probably going to need to work on #9703 (updating the PyTorch pin) before this one. Before doing that, check the CI failures in that PR. It might just be that you need land them together: add #9703 changes to this PR.
i suggest to check in https://github.com/pytorch/xla/pull/9703 before submitting this PR and keep the two PR separately. I can take a look at https://github.com/pytorch/xla/pull/9703 if you cannot find anyone working on it.
I won't be able to keep working on it. Since you need that for this PR, I was just giving you a heads up. Let me know if you need any help.