Device Registration Mechanism for New backend

Hi All,
I am new to pytorch and would like to register a new device with pytoch, can some one point me to a good documentation for the same along with some example codes.

Regards
Amit