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

It should be safe to remove the old torch::make_unique functions.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/108866
Approved by: https://github.com/albanD
This commit is contained in:
cyy
2023-09-14 20:52:21 +00:00
committed by PyTorch MergeBot
parent f03b8abd47
commit 03e35efbf7
54 changed files with 53 additions and 134 deletions

View File

@ -167,7 +167,7 @@ class PytorchJni : public facebook::jni::HybridClass<PytorchJni> {
assetName->toStdString().c_str());
}
JITCallGuard guard;
module_ = torch::jit::load(torch::make_unique<MemoryReadAdapter>(
module_ = torch::jit::load(std::make_unique<MemoryReadAdapter>(
assetBuffer, AAsset_getLength(asset)));
AAsset_close(asset);
module_.eval();

View File

@ -132,7 +132,7 @@ class PytorchJni : public facebook::jni::HybridClass<PytorchJni> {
}
LiteJITCallGuard guard;
module_ =
torch::jit::_load_for_mobile(torch::make_unique<MemoryReadAdapter>(
torch::jit::_load_for_mobile(std::make_unique<MemoryReadAdapter>(
assetBuffer, AAsset_getLength(asset)));
AAsset_close(asset);
deviceType_ = deviceJniCodeToDeviceType(device);