How to lazy_init for other backends

I’m using privateuse1 to add our backend. My customer find the following code is working in cuda, but not working in my backend.

import torch
tensor_a  = torch.rand(2).to("cuda")

In my backend, it will raise RuntimeError in getDevice in func ensure_has_index, because my device was not initialized.
CUDA is ok is because of the cuda_lazy_init in THPVariable_to.
So I want to discuss how privateuse1 to support this case