fixed nn.Module.to type hint (#108767)
Fixes #108675
- [x] adds `str` as option for `device`
- [x] use `typing_extensions.Self` instead of `T`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/108767
Approved by: https://github.com/ezyang