Revert "replace torch::make_unique with std::make_unique (#108866)"

This reverts commit 03e35efbf733da28d9e1c5a4b1b203fe335b5f94.

Reverted https://github.com/pytorch/pytorch/pull/108866 on behalf of https://github.com/clee2000 due to Sorry but I found more usages of `torch::make_unique` internally, I can go change all of these, but I'd prefer if that gets done before this gets merged ([comment](https://github.com/pytorch/pytorch/pull/108866#issuecomment-1722577925))
This commit is contained in:
PyTorch MergeBot
2023-09-17 21:57:30 +00:00
parent 07f2efa285
commit 525e4f42d0
54 changed files with 134 additions and 53 deletions

View File

@ -525,7 +525,7 @@ mobile::Module _load_for_mobile_impl(
}
const size_t model_size = rai != nullptr ? rai->size() : 0;
auto reader = std::make_unique<PyTorchStreamReader>(std::move(rai));
auto reader = torch::make_unique<PyTorchStreamReader>(std::move(rai));
if (module_load_options &
MobileModuleLoadOptions::PARSE_ALL_EXTRA_FILE_MAPS) {
// ExtraFilesMap is serialized with a "extra/", hence it is necessary to
@ -694,7 +694,7 @@ void _load_extra_only_for_mobile(
case FileFormat::ZipFileFormat: {
std::unique_ptr<FileAdapter> rai =
std::make_unique<FileAdapter>(filename);
auto reader = std::make_unique<PyTorchStreamReader>(std::move(rai));
auto reader = torch::make_unique<PyTorchStreamReader>(std::move(rai));
BytecodeDeserializer deserializer(std::move(reader));
deserializer.deserialize_only_extra(device, extra_files);
break;