Restore device in cpp API (#14711)
authorLu Fang <lufang@fb.com>
Tue, 4 Dec 2018 08:44:43 +0000 (00:44 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 4 Dec 2018 08:46:41 +0000 (00:46 -0800)
commit6e0c5a8a4e03e489b60f8d72692f27ea6f377a67
tree6b2fef26377c35e71849d9fb1001e127d7f9eac9
parentcbd805169f6d37c5cf68869c84f95bd9f340845d
Restore device in cpp API (#14711)

Summary:
This is a stack PR based on https://github.com/pytorch/pytorch/pull/14454.

It enables the restoring the storage to appropriate device.

~~[TODO]: add/modify appropriate tests~~ Done
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14711

Reviewed By: dzhulgakov

Differential Revision: D13315746

Pulled By: houseroad

fbshipit-source-id: fe6f24a45c35e88fd1a2eebc09950d4430fac185
test/cpp/api/serialize.cpp
torch/csrc/api/include/torch/serialize/input-archive.h
torch/csrc/api/src/serialize/input-archive.cpp
torch/csrc/jit/import.cpp
torch/csrc/jit/import.h