Add pickler support for Device (#30131)
Summary:
This PR adds (un)pickling support for `c10::Device`. It also adds `torch.device` as a type annotation for device attributes.
](https://our.intern.facebook.com/intern/diff/18664421/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30131
Pulled By: driazati
Differential Revision: D18664421
fbshipit-source-id: 64378fb42b2d1bbe2bd86259e5ed10f24b5d1e49