Remove TH/THC Storage data and copy functions (#68127)

Summary:
Part of https://github.com/pytorch/pytorch/issues/67852

cc ezyang bhosmer smessmer ljk53 bdhirsh

Pull Request resolved: https://github.com/pytorch/pytorch/pull/68127

Reviewed By: mrshenli

Differential Revision: D32441885

Pulled By: ngimel

fbshipit-source-id: 1bbe7c8bed30bfe1737511a4f347fd9a8024dd99
This commit is contained in:
Kurt Mohler
2021-11-17 11:10:24 -08:00
committed by Facebook GitHub Bot
parent 4e21d77dbb
commit 3b4f072383
26 changed files with 68 additions and 367 deletions

View File

@ -189,6 +189,15 @@ void THPPointer<THPStorage>::free() {
Py_DECREF(ptr);
}
void storage_copy(at::Storage dst, at::Storage src, bool non_blocking) {
auto dst_options = c10::TensorOptions().device(dst.device()).dtype(at::kByte);
auto dst_t = at::empty({0}, {}, dst_options).set_(dst);
auto src_options = c10::TensorOptions().device(src.device()).dtype(at::kByte);
auto src_t = at::empty({0}, {}, src_options).set_(src);
dst_t.copy_(src_t, non_blocking);
}
template class THPPointer<THPStorage>;
namespace torch { namespace gdb {