[test_nn] add custom device support for dropout tests、lazy_modules te… (#106609)
add custom device support for dropout tests、lazy_modules tests and multihead_attention tests.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/106609
Approved by: https://github.com/mikaylagawarecki