Add an option to getWriteableTensorData to avoid copy CUDA tensor to CPU (#46524)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/46524
Test Plan: Imported from OSS
Reviewed By: wanchaol
Differential Revision: D24392794
Pulled By: mrshenli
fbshipit-source-id: 21bf81dfc6c1d81689f8278d81f4c8776bc76ec1