[android][vulkan] Fix model loading for Vulkan backend (#63402)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/63402
Test Plan: Imported from OSS
Reviewed By: SS-JIA
Differential Revision: D30370692
Pulled By: IvanKobzarev
fbshipit-source-id: 73311b9b767fe9ed3ae390db59d6aa2c4a98f06d
diff --git a/android/pytorch_android/src/main/cpp/pytorch_jni_jit.cpp b/android/pytorch_android/src/main/cpp/pytorch_jni_jit.cpp
index d91e553..f60fd51 100644
--- a/android/pytorch_android/src/main/cpp/pytorch_jni_jit.cpp
+++ b/android/pytorch_android/src/main/cpp/pytorch_jni_jit.cpp
@@ -121,7 +121,7 @@
}
deviceType_ = deviceJniCodeToDeviceType(device);
module_ = torch::jit::load(
- std::move(modelPath->toStdString()), deviceType_, extra_files);
+ std::move(modelPath->toStdString()), c10::nullopt, extra_files);
if (has_extra) {
static auto putMethod =
facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString>::
diff --git a/android/pytorch_android/src/main/cpp/pytorch_jni_lite.cpp b/android/pytorch_android/src/main/cpp/pytorch_jni_lite.cpp
index ff74135..b677996 100644
--- a/android/pytorch_android/src/main/cpp/pytorch_jni_lite.cpp
+++ b/android/pytorch_android/src/main/cpp/pytorch_jni_lite.cpp
@@ -83,9 +83,9 @@
}
deviceType_ = deviceJniCodeToDeviceType(device);
module_ = torch::jit::_load_for_mobile(
- std::move(modelPath->toStdString()), deviceType_, extra_files);
+ std::move(modelPath->toStdString()), c10::nullopt, extra_files);
torch::jit::_load_extra_only_for_mobile(
- std::move(modelPath->toStdString()), deviceType_, extra_files);
+ std::move(modelPath->toStdString()), c10::nullopt, extra_files);
if (has_extra) {
static auto putMethod =
facebook::jni::JMap<facebook::jni::JString, facebook::jni::JString>::