[Reland] Move torch::make_unique to std::make_unique (#109780)

We can first try to move torch::make_unique to std::make_unique despite reverting of #108866 .

Pull Request resolved: https://github.com/pytorch/pytorch/pull/109780
Approved by: https://github.com/ezyang
This commit is contained in:
cyy
2023-09-21 18:30:21 +00:00
committed by PyTorch MergeBot
parent c6b9481c15
commit e9e93c5350
52 changed files with 53 additions and 92 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);