From c982f13a80614cd5b126dd74879ee2011d34e850 Mon Sep 17 00:00:00 2001 From: Ivan Kobzarev Date: Tue, 17 Aug 2021 10:12:11 -0700 Subject: [PATCH] [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 --- android/pytorch_android/src/main/cpp/pytorch_jni_jit.cpp | 2 +- android/pytorch_android/src/main/cpp/pytorch_jni_lite.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 d91e553810cf..f60fd51c6f1f 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 @@ class PytorchJni : public facebook::jni::HybridClass { } 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:: 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 ff74135049fd..b67799672ec2 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 @@ class PytorchJni : public facebook::jni::HybridClass { } 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::