Storage.clone maintains original device (#14751)
authorFrancisco Massa <fvsmassa@gmail.com>
Wed, 5 Dec 2018 16:27:00 +0000 (08:27 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 5 Dec 2018 16:33:56 +0000 (08:33 -0800)
commit2d958b7f7745acbe6bd72a4de1781b0b16861095
tree475d30891e49da61b3a9ae6fcfa6acebbbbf28c9
parenta80a46a6d01b792399d5860e00923d096399952f
Storage.clone maintains original device (#14751)

Summary:
Fixes https://github.com/pytorch/pytorch/issues/14673

As pointed out by vishwakftw , the root case of the `deepcopy` issue was that `storage.clone()` would create a new storage in the default device.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14751

Reviewed By: soumith

Differential Revision: D13323061

Pulled By: fmassa

fbshipit-source-id: bfe46ebd78f0b6cd9518c11d09de7849282ed2a2
test/test_cuda.py
torch/storage.py