mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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:
committed by
Facebook GitHub Bot
parent
4e21d77dbb
commit
3b4f072383
@ -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 {
|
||||
|
Reference in New Issue
Block a user